Bug report #5718

OpenStreetMap plugin corrupts Unicode characters when uploading to the server

Added by Leyan Ouyang almost 12 years ago. Updated about 11 years ago.

Status:Closed
Priority:Normal
Assignee:Martin Dobias
Category:Python plugins
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:15236

Description

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.

History

#1 Updated by Marco Hugentobler almost 12 years ago

  • Pull Request or Patch supplied changed from No to Yes

#2 Updated by Marco Hugentobler almost 12 years ago

  • Assignee set to Martin Dobias

#3 Updated by Paolo Cavallini over 11 years ago

  • Target version set to Version 2.0.0

#4 Updated by Giovanni Manghi over 11 years ago

  • Priority changed from High to Normal

#5 Updated by Alexander Bruy about 11 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

Seems this can be closed, because OSM plugin removed from master

Also available in: Atom PDF