Skip to content

Commit

Permalink
Fix encoding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fdiazcarsi committed Dec 5, 2022
1 parent 3dc8bf9 commit 57a541e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions quickinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def getTooltipValue(self, point, projection):
trace('QuickInfo.getTooltipValue: %s point %s, no records selected return ""' % (repr(fieldName), point.convertToWKT()) )
return ""
if mode == "useField":
return str(firstfeature.get(fieldName))
return firstfeature.get(fieldName)

# Eval expression with expression
manager = ExpressionEvaluatorLocator.getManager()
Expand Down Expand Up @@ -113,7 +113,10 @@ def point(self, event):
p = event.getMapPoint()
p = p.buffer(self.__tolerance).getEnvelope().getGeometry()
tip = self.quickinfo.getTooltipValue(p,self.projection)
self.mapControl.setToolTipText(unicode(tip, 'utf-8'))
if isinstance(tip, unicode):
self.mapControl.setToolTipText(tip)
else :
self.mapControl.setToolTipText(unicode(tip, 'utf-8', 'ignore'))

def main(*args):
viewDoc = gvsig.currentView()
Expand Down

0 comments on commit 57a541e

Please sign in to comment.