Bug #5815
Unicode bug in Geocoding Plugin
| Status: | Closed | Start Date: | 06/18/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | Python plugins and bindings | |||
| Target version: | Version 1.8.0 | |||
| Platform: | Patch supplied: | No | ||
| Platform version: | Affected version: | 1.8.0 | ||
| Status info: | Causes crash or corruption: | No | ||
| Resolution: | invalid |
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
Updated by Giovanni Manghi about 1 year ago
- Status changed from New to Closed
- Resolution set to invalid
Geocoding is a 3rd party plugin so the ticket should be file here
http://hub.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!