OpenStreetMap plugin corrupts Unicode characters when uploading to the server
|Assigned to:||Martin Dobias||% Done:||
|Category:||Python plugins and bindings|
|Target version:||Version 2.0.0|
|Platform version:||Affected version:||master|
|Status info:||Causes crash or corruption:||No|
I used the OpenStreetMap plugin to change some streets name in China. I was able to type the characters without issues and upload the data, but when I went to check on the website, the result was only lines of "???" : http://www.openstreetmap.org/browse/changeset/11776889
After investigation, it is caused by the conversion of the prepared XML diff to ASCII before sending it, in python/plugins/osm/OsmUploadDlg.py:
requestBytes = requestXml.toAscii()
httpSessionId = self.http.request(header, requestBytes)
This is done for each of the 9 different processes.
I just tried with a toUtf8() and it seemed to work (http://www.openstreetmap.org/browse/changeset/11777700, you can see the "created_by = QGIS OSM v0.5" and the correct name of the street modified), but I am no expert in this. Everything before this last step seems to be prepared for utf8, so is there any special reason to convert to ASCII before sending ?
I think it is high priority as right now it is sending corrupted data silently to the OpenStreetMap server.