[Mapbender-dev] json_encode, ISO-8859-1, Ticket 171

Thomas Baschetti info at thomas-baschetti.de
Tue Sep 15 10:10:39 EDT 2009


while exploring http://trac.osgeo.org/mapbender/ticket/171
i got a little bit stuck.
The problem seems to in


the line

$output = $json->encode($resultObj);

which fails if the database is not UTF-8 but ISO-8859-1
see http://de.php.net/manual/en/function.json-encode.php
"This function only works with UTF-8 encoded data." If you use e.g. 
german umlauts in ISO you will get "Oberfl" instead of "Oberfläche".
So, converting values to UTF-8 is necessary, but when and where?
Right after retrieving the values from the database or just before
using json_encode? And are other files affected, too?

Any hints?


Thomas Baschetti - Systemanalyse Geographische Informationssysteme
Hakenstraße 8D
49074 Osnabrück

Tel: 0541 25 91 90 | mobil 01577 189 25 91
E-Mail: info at thomas-baschetti.de
Ust-IdNr.: DE264355072

More information about the Mapbender_dev mailing list