working with database in UTF-8

Steve Lime Steve.Lime at DNR.STATE.MN.US
Fri Jun 22 13:52:27 EDT 2007


Hmmm... All the encoding parameter does is tell MapServer to convert from the supplied encoding to
unicode so I don't think it has any effect. If you already have unicode/utf-8 strings then this should
just work assuming your font has the right characters.

Does a simple shapefile work?

Steve

>>> On 6/22/2007 at 2:56 AM, in message
<bfb704a40706220056t20220029n82b4ec43aa5e3854 at mail.gmail.com>, Jackey Cheung
<cheung.jackey at GMAIL.COM> wrote:
> Greetings!
> 
> I'm trying to setup a mapserver that supports multiple languages with MySQL.
> The database uses UTF-8, while the map server use a select statement to
> retrieve records. The layer goes as:
> 
>     LAYER
>         NAME                        sr
>         STATUS                    OFF
> 
>         TYPE                        POINT
>         CONNECTIONTYPE    OGR
>         CONNECTION            "<OGRVRTDataSource>
>                                             <OGRVRTLayer name='sr'>
> 
> <SrcDataSource>MYSQL:MapSQL,user=root,password=123456,host=localhost,port=3306
> ,tables=POI</SrcDataSource>
>                                                 <SrcSQL>SELECT `Name`, geom
> FROM `POI` WHERE `ID` = %o%</SrcSQL>
> 
> <GeometryType>wkbPoint</GeometryType>
>                                             </OGRVRTLayer>
>                                          </OGRVRTDataSource>"
>         DATA                        "sr"
>         UNITS                        METERS
> 
>         MAXFEATURES            1
>         LABELITEM                "Name"
> 
>         CLASS
>             SYMBOL                    "point"
>             MINSIZE                    10
>             COLOR                        250    0    0
>             OUTLINECOLOR        0    128    0
> 
>             LABEL
>                 ENCODING            "utf-8"
>                 COLOR                    255    0    0
>                 OUTLINECOLOR    255    255    255
>                 TYPE                    TRUETYPE
>                 FONT                    arial
>                 SIZE                    8
>                 ANTIALIAS            TRUE
>                 POSITION            UC
>                 PARTIALS            FALSE
>                 BUFFER                5
>                 FORCE                    TRUE
>             END
>         END
>     END
> 
> All Chinese characters are shown as question marks (?) on the map, no mater
> using arial or Chinese fonts.
> 
> Any advise?



More information about the mapserver-users mailing list