From 89fe64e513430b6e10940772a46cb2edeaa2f335 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Tue, 30 Aug 2011 21:26:21 -0400 Subject: dxf export. support for non-ascii characters (Bug 834721) Fixed bugs: - https://launchpad.net/bugs/834721 (bzr r10606) --- share/extensions/dxf_outlines.inx | 6 ++++++ share/extensions/dxf_outlines.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/share/extensions/dxf_outlines.inx b/share/extensions/dxf_outlines.inx index dcea77005..534eeb814 100644 --- a/share/extensions/dxf_outlines.inx +++ b/share/extensions/dxf_outlines.inx @@ -19,6 +19,12 @@ <_item value="1./90">in <_item value="1./1080">ft + + Latin 1 + CP 1250 + CP 1252 + UTF 8 + <_param name="inputhelp" type="description" xml:space="preserve">- AutoCAD Release 14 DXF format. diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py index f6fa26ba1..e8cb58848 100755 --- a/share/extensions/dxf_outlines.py +++ b/share/extensions/dxf_outlines.py @@ -63,6 +63,7 @@ class MyEffect(inkex.Effect): self.OptionParser.add_option("-R", "--ROBO", action="store", type="string", dest="ROBO") self.OptionParser.add_option("-P", "--POLY", action="store", type="string", dest="POLY") self.OptionParser.add_option("--units", action="store", type="string", dest="units") + self.OptionParser.add_option("--encoding", action="store", type="string", dest="char_encode", default="latin_1") self.OptionParser.add_option("--tab", action="store", type="string", dest="tab") self.OptionParser.add_option("--inputhelp", action="store", type="string", dest="inputhelp") self.dxf = [] @@ -75,7 +76,7 @@ class MyEffect(inkex.Effect): def output(self): print ''.join(self.dxf) def dxf_add(self, str): - self.dxf.append(str) + self.dxf.append(str.encode(self.options.char_encode)) def dxf_line(self,csp): self.handle += 1 self.dxf_add(" 0\nLINE\n 5\n%x\n100\nAcDbEntity\n 8\n%s\n 62\n%d\n100\nAcDbLine\n" % (self.handle, self.layer, self.color)) -- cgit v1.2.3