[mapserver-dev] encodings

Thomas Bonfort thomas.bonfort at camptocamp.com
Fri May 15 05:53:45 EDT 2009


Hi devs,

Mapserver currently has a hard time treating encodings. We have the
ENCODING keyword at the label level, and that works when displaying
labels, but not when treating datasources:
* (probably, not sure here) when sending request strings, eg to postgis
* when using class expressions, eg ("[nature]" == "Forêt"), if the
mapfile encoding doesn't match the data encoding.

I think we could clean things up a bit:

* add an ENCODING keyword at the map level, that specifies how the
mapfile is encoded on the filesystem (what would the default value be:
utf8, latin1, cpXXX ?)
* add an ENCODING keyword at the LAYER level, to specify the encoding
of the datasource. (the encoding at the label level would become
deprecated). The default would be to inherit from the mapfile
encoding.
* when doing expression tests, we'd iconv the strings before doing
regular char* comparisons if map->encoding != layer->encoding
* when passing query strings to postgis, map->encoding could be used
to specify PGCLIENTENCODING. Don't know if / how that can be adapted
to other drivers.

Any better ideas for treating this?

If there are no objections, I can write up a quick rfc for this.

regards,

thomas


www.camptocamp.com
+33 4 79 26 57 97


More information about the mapserver-dev mailing list