Bug report #5815

Unicode bug in Geocoding Plugin

Added by Bo Victor Thomsen over 12 years ago. Updated over 12 years ago.

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

Description

I've encountered an error when using the Geocoding plugin ver. 2.3 in QGIS ver. 1.8
If you specify an address containing a non-ascii character - one which returns several candidates - and choose one the candidates, You'll get an error:

"An error has occured while executing Python code:

Traceback (most recent call last):
File "C:/Users/Bo Victor Thomsen/.qgis//python/plugins\\GeoCoding\\GeoCoding.py", line 233, in geocode
point = places[str(place_dlg.placesComboBox.currentText())]
UnicodeEncodeError: 'ascii' codec can't encode character u'\\xc5' in position 0: ordinal not in range(128)

Python version:
2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]

QGIS version:
1.8.0-Lisboa Lisboa, 6416f38
"
The test-address was "Åbrinken"

After a little bit of Google - digging (I know absolutely zilch about Python) I changed the following codelines in GeoCoding.py:

233 point = places[str(place_dlg.placesComboBox.currentText())]
234 self.process_point(str(place_dlg.placesComboBox.currentText()), point)

to:

233 point = places[unicode(place_dlg.placesComboBox.currentText())]
234 self.process_point(unicode(place_dlg.placesComboBox.currentText()), point)

after which the error disappeared.

History

#1 Updated by Giovanni Manghi over 12 years ago

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

Geocoding is a 3rd party plugin so the ticket should be file here

https://issues.qgis.org/projects/qgis-user-plugins

if the author did not created yet the sub-project on this tracker please ask him to do so. Cheers!

Also available in: Atom PDF