From 253907d15f80369cd6a900007d5460caca4517aa Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 31 Oct 2016 23:54:13 -0200 Subject: [PATCH] Draft: temporary workaround for techdraw with no utf --- src/Mod/Draft/Draft.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index d75522ede..9b6ce84c2 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -2015,6 +2015,17 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct if techdraw: svg = "" for i in range(len(text)): + t = text[i] + if not isinstance(t,unicode): + t = t.decode("utf8") + # temporary workaround for unsupported UTF8 in techdraw + try: + import unicodedata + except: + t = "" + print "Draft.getSVG: unicodedata not available" + else: + t = u"".join([c for c in unicodedata.normalize("NFKD",t) if not unicodedata.combining(c)]).encode("utf8") svg += '\n' + svg += '>\n' + t + '\n' else: svg = '