pnorman / ogr2osm

pnorman's version of UVM's Rewrite of ogr2osm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

utf-8 encoding xml output

yvecai opened this issue · comments

Better results are obtained using an explicit utf-8 encoding of tag values:

f.write(etree.tostring(xmlobject, pretty_print=True,encoding='UTF-8'))

Please provide a testcase where the current method has issues so that the changes can be verified

commented

In some cases it works for me if I make a .cpg file - used to specify the code page (only for .dbf) for identifying the character encoding to be used. And put in it the encoding:
utf-8

It's also worth noting that the encoding of shapefiles is an absolute mess. The spec default is not UTF-8 but this is becoming the de-facto default.

You may need to use some combination of ogr2ogr and ogr2osm encoding settings to get sensible results.