Hi,

I made a little test as well and this is how my mapfile behaves here in Finland:


1)      Write your mapfile in Latin 1 and save

2)      Change encoding with Notepad++ from ANSI into UTF-8

Changing the encoding with Notepad++ is changing the non-ascii characters into 
UTF-8 strings which show as boxes with black background in Notepad++

äö -> xE4 xF6

This file works with MS4W. What does not work is to have the mapfile in UTF-8 
and then write special characters (äö) from the keyboard. This is the opposite 
to  what needs to be done for Linux. For Linux it is not enough to change the 
encoding with Notepad++ but special characters must be re-written from the 
keyboard while the document is already in UTF-8.

I am not sure if there is a clean solution. I suppose that it is not enough to 
edit the mapfiles but user should also set Windows to use UTF-8 encoding which 
may not be simple 
https://superuser.com/questions/1033088/is-it-possible-to-set-locale-of-a-windows-application-to-utf-8.
  Read about Windows locales and codepages and go on with testing if it feels 
important and report about your experiences. Myself I have not bothered even it 
would be nice to be able to use the same, UTF-8 encoded mapfiles both on Linux 
and on Windows. Special characters in paths is a bad idea and users can claim 
themselves from the problems but it is not possible to avoid special characters 
for example in filters and expressions if they appear in the source data.

-Jukka Rahkonen-

Lähettäjä: mapserver-users [mailto:[email protected]] 
Puolesta [email protected]
Lähetetty: 24. tammikuuta 2018 10:27
Vastaanottaja: [email protected]
Aihe: [mapserver-users] Mapserver, mapfile in utf8 and data-path


Hello community!

I use Mapserver 7.0.7 in ms4w 3.2.3 package on Win Server 2012 R2. Now i tried 
to generate a simple mapfile in utf8 encoding with this layer:

LAYER

    Name "freiflaechen"

    DATA "C:\Vektordaten\freiflächen\freiflä_zusammen.shp"

    TYPE polygon

    STATUS on

    CLASS

      COLOR 102 185 120

    END

END

Unfortunately it doesn't work because there a some special character in the 
path and in the file name. So if i change the encoding of my mapfile to LATIN1, 
everything works fine. Also if i remove the special character from the path and 
in file name. But i look for a clean solutuion. I have many files to be shown 
with mapserver that have special characters and i want to handle my mapfile in 
the prescribe utf8 encoding.

Any ideas?



Best regards



Evgeni Tcherkasski
_______________________________________________
mapserver-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to