[fusion-trac] #81: MapServer/php/LoadMap.php sends native php string instead of utf8-encoded string

Fusion trac_fusion at osgeo.org
Fri Jun 20 03:24:00 EDT 2008


#81: MapServer/php/LoadMap.php sends native php string instead of utf8-encoded
string
---------------------------+------------------------------------------------
   Reporter:  schneiderei  |       Owner:  madair             
       Type:  defect       |      Status:  new                
   Priority:  P2           |   Milestone:  1.1                
  Component:  MapServer    |     Version:  1.0.6              
   Severity:  Major        |    Keywords:  encoding, php, ajax
External_id:               |       State:  New                
    Browser:  All          |          Os:  All                
---------------------------+------------------------------------------------
 Using MapServer 5.0.2 as rendering engine for my Fusion application, I
 have issues with character encoding: All my ä, ö, and ü became ? or other
 cryptic characters. I did some research, and I think that the problem
 comes from encoding heterogeneities: Ajax sends strings as utf8 by
 default, php uses 1byte strings by default.

 MapServer/php/LoadMap.php is responsible for generating a json-string from
 what MapScript reads from the map file. It sends it back via Ajax with:

 echo var2json($mapObj);

 The function var2json generates a regular php string. I believe that this
 string needs to be converted to utf8 before it can be sent. I altered the
 above line to:

 echo utf8_encode(var2json($mapObj));

 and my ä, ö, and ü are now displayed properly in the Fusion application.

-- 
Ticket URL: <http://trac.osgeo.org/fusion/ticket/81>
Fusion <http://trac.osgeo.org/fusion>
Fusion is a web-mapping application development framework for MapServer and MapGuide OS.


More information about the fusion-trac mailing list