Navigation Menu

Skip to content

Commit

Permalink
use utf-8 for coin4 and latin1 for coin3
Browse files Browse the repository at this point in the history
  • Loading branch information
5263 authored and wwmayer committed Sep 14, 2014
1 parent a0e461a commit 5d40614
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/Mod/Draft/Draft.py
Expand Up @@ -3345,21 +3345,24 @@ def updateData(self, obj, prop):
# set text value
l = self.p3.sub(self.p2).Length
if hasattr(obj.ViewObject,"Decimals"):
self.string = DraftGui.displayExternal(l,obj.ViewObject.Decimals,'Length',su).encode("utf8")
self.string = DraftGui.displayExternal(l,obj.ViewObject.Decimals,'Length',su)
else:
self.string = DraftGui.displayExternal(l,getParam("dimPrecision",2),'Length',su).encode("utf8")
self.string = DraftGui.displayExternal(l,getParam("dimPrecision",2),'Length',su)
if hasattr(obj.ViewObject,"Override"):
if obj.ViewObject.Override:
try:
from pivy import coin
if coin.COIN_MAJOR_VERSION >= 4:
self.string = obj.ViewObject.Override.encode("utf8").replace("$dim",self.string)
else:
self.string = obj.ViewObject.Override.encode("utf8").replace("$dim",self.string).decode("latin1","replace")
except:
self.string = obj.ViewObject.Override.encode("utf8").replace("$dim",self.string).decode("latin1","replace")
self.text.string = self.text3d.string = self.string

self.string = obj.ViewObject.Override.replace("$dim",\
self.string)
try:
from pivy import coin
coin4 = coin.COIN_MAJOR_VERSION >= 4
except ImportError, AttributeError:
coin4 = False
if coin4:
self.text.string = self.text3d.string = \
self.string.encode('utf-8')
else:
self.text.string = self.text3d.string = \
self.string.encode('latin1')
# set the distance property
if round(obj.Distance.Value,precision()) != round(l,precision()):
obj.Distance = l
Expand Down

0 comments on commit 5d40614

Please sign in to comment.