From dc4625b4314cb8a6235c941586048f106be9d30c Mon Sep 17 00:00:00 2001
From: Ulrich Brammer <ubrammer@t-online.de>
Date: Wed, 12 Feb 2014 22:02:54 +0100
Subject: Enable unicode in Drawing Dimensions

---
 src/Mod/Draft/Draft.py |   35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py
index 55dc894..b83355e 100644
--- a/src/Mod/Draft/Draft.py
+++ b/src/Mod/Draft/Draft.py
@@ -1636,20 +1636,20 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct
         return svg
         
     def getText(color,fontsize,fontname,angle,base,text):
-        svg = '<text fill="'
-        svg += getrgb(color) +'" font-size="'
-        svg += str(fontsize) + '" '
-        svg += 'style="text-anchor:middle;text-align:center;'
-        svg += 'font-family:'+ fontname +'" '
-        svg += 'transform="rotate('+str(math.degrees(angle))
-        svg += ','+ str(base.x) + ',' + str(base.y) + ') '
-        svg += 'translate(' + str(base.x) + ',' + str(base.y) + ') '
+        svg = u'<text fill="'
+        svg += getrgb(color) +u'" font-size="'
+        svg += str(fontsize) + u'" '
+        svg += u'style="text-anchor:middle;text-align:center;'
+        svg += u'font-family:'+ fontname +u'" '
+        svg += u'transform="rotate('+str(math.degrees(angle))
+        svg += u','+ str(base.x) + ',' + str(base.y) + u') '
+        svg += u'translate(' + str(base.x) + u',' + str(base.y) + u') '
         #svg += 'scale('+str(tmod/2000)+',-'+str(tmod/2000)+') '
-        svg += 'scale(1,-1) '
-        svg += '" freecad:skip="1"'
-        svg += '>\n'
+        svg += u'scale(1,-1) '
+        svg += u'" freecad:skip="1"'
+        svg += u'>\n'
         svg += text
-        svg += '</text>\n'
+        svg += u'</text>\n'
         return svg
 
         
@@ -3104,13 +3104,14 @@ class _ViewProviderDimension(_ViewProviderDraft):
             # set text value
             l = self.p3.sub(self.p2).Length
             if hasattr(obj.ViewObject,"Decimals"):
-                fstring = "%." + str(obj.ViewObject.Decimals) + "f"
+                fstring = u"%." + unicode(obj.ViewObject.Decimals) + u"f"
             else:
-                fstring = "%." + str(getParam("dimPrecision",2)) + "f"
-            self.string = (fstring % l)
+                fstring = u"%." + unicode(getParam("dimPrecision",2)) + u"f"
+            self.string = unicode(fstring % l)
             if obj.ViewObject.Override:
-                self.string = unicode(obj.ViewObject.Override).encode("latin1").replace("$dim",self.string)
-            self.text.string = self.text3d.string = self.string
+                self.string = unicode(obj.ViewObject.Override).replace(u"$dim",self.string)
+            self.text.string = self.string.encode("latin1")
+            self.text3d.string = self.string.encode("latin1")
 
             # set the distance property
             if round(obj.Distance,precision()) != round(l,precision()):
-- 
1.7.10.4

