[mapserver-users] Expression encoding must be in the same encoding than the data

Akio Takubo takubo at saruga-tondara.net
Wed Jun 25 09:21:03 PDT 2008


Hi, 

Unfortunately there is no way to tell to mapserver what encoding mapfile uses or 
what encoding each layer's datasource uses. 
So simple way is convert your mapfile's encoding to datasource's one(CP1252). 

If you use mapscript, you have a chance to know each layer's datasource encoding
or mapfile's own encoding with setting "METADATA" tag and covert expression string internally. 
Recent version of p.mapper framework do it. 

Thanks, 

  Akio Takubo takubo at saruga-tondara.net

On Wed, 25 Jun 2008 11:30:52 +0200
"SAEZ Laurent - CETE Méditerr./DI/ETER" <Laurent.Saez at developpement-durable.gouv.fr> wrote:

> Hi list,
> 
> Encoding in expression is not very simple...
> I have :
> 
>     * mapserver 4.99,
>     * a mapfile utf-8 encoded,
>     * a mapinfo file create on windows (encoding cp1252),
>     * one class using a field which contain this value : "Départementale".
> 
> If I write in the mapfile the following expression :
> ...
> CLASS
> NAME "Départementale"
> EXPRESSION "Départementale"
> ...
> 
> This class is not in the raster returned by the WMS/GetMap request.
> To obtain this class I have to encode the string expression in the same 
> encoding than the data (mapinfo tab) :
> 
> CLASS
> NAME "Départementale"
> EXPRESSION "D?partementale"
> 
> So it's strange to encode a string in cp1252 (or iso-8859-1) in a file 
> encoding in utf-8.
> 
> Is there a way to tell mapserver that my layer is cp1252 encoded ?
> 
> Thanks for help
> 
> 



More information about the MapServer-users mailing list