Permalink
Browse files

Decode strings before passing them to the translation function.

This may cause issues with existing translations of non-UTF8 source files
but requires more testcases to be sure.

Additionally it requires testcases for different encodings.

Hopefully this fixes #11
  • Loading branch information...
1 parent cc0ab13 commit 7b94a62d2e409624a251d04a99459158e402851a @pnorman committed Nov 15, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 ogr2osm.py
View
@@ -391,7 +391,7 @@ def getLayerFields(layer):
def getFeatureTags(ogrfeature, fieldNames):
tags = {}
for i in range(len(fieldNames)):
- tags[fieldNames[i]] = ogrfeature.GetFieldAsString(i)
+ tags[fieldNames[i].decode(options.encoding)] = ogrfeature.GetFieldAsString(i).decode(options.encoding)
return translations.filterTags(tags)
def parseLayer(layer):

0 comments on commit 7b94a62

Please sign in to comment.