[OSM-dev] Error with API request to local server
Andy Allan
gravitystorm at gmail.com
Wed Nov 19 10:47:45 GMT 2008
On Wed, Nov 19, 2008 at 10:27 AM, Tom Hughes <tom at compton.nu> wrote:
> Matthias Brandt wrote:
>
>> The 3rd entry has an german umlaut, so I think libxml has problems with
>> reading/processing UTF-8 chars. What can I do? Obviously, you don't have
>> these problems at openstreetmap.org...
>
> No, but then our database has it's character encodings buggered up in
> interesting ways...
>
> I assume that your database encoding is set to UTF-8?
>
> The next question is then how you got your data into the database? Did
> you do it through rails? or with osmosis? or something else?
>
> One thing you may to try is adding "encoding: utf8" to the database
> connection details in config/database.yml and seeing if that helps.
Also, be careful with the command line mysql client. By default it'll
connect to a utf8 database with a latin1 connection, so bona-fide utf8
characters in a utf8 db viewed using mysql client on a utf8 aware
terminal will (still) be borked. You need to supply
--default-character-set=utf8 parameter.
Also also, I'd encourage you to try the 0.6 branch, since it's first
where all the action is, and secondly there's unit tests in there for
checking that the API can store utf8 characters correctly in the db.
Running 'rake test:units' (or even just 'rake test') will let you know
if there's a charset problem, which will help with the diagnosis.
Cheers,
Andy
More information about the dev
mailing list