dxf import: encoding problem

Bug #397793 reported by hefee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

Hello,

I have inkscape 0.46 from debian unstable but with the newest dxf_import script (dxf_import.py - Version21453). I had an problem by importing an dxf-file from qcad. I found out that there is a problem with BLOCK-Names that have spaces ore special letters like äöü... I've written a patch for that bug, that encodes the names. By the way it'd be grat if you use the Id tag in files so everyone can see what version is newer or older...

---dxf_input.py-v21453 2009-07-10 11:23:26.000000000 +0200
+++ dxf_input.py 2009-07-10 13:00:44.000000000 +0200
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 '''
+#$id:$
 dxf_input.py - input a DXF file >= (AutoCAD Release 13 == AC1012)

 Copyright (C) 2008, 2009 Alvin Penner, <email address hidden>
@@ -24,6 +25,7 @@

 import inkex, simplestyle, math
 from StringIO import StringIO
+from urllib import quote

 def export_MTEXT():
     # mandatory group codes : (1 or 3, 10, 20) (text, x, y)
@@ -238,7 +240,7 @@
     if vals[groups['2']] and vals[groups['10']] and vals[groups['20']]:
         x = vals[groups['10']][0]
         y = vals[groups['20']][0] - scale*ymax
- attribs = {'x': '%f' % x, 'y': '%f' % y, inkex.addNS('href','xlink'): '#' + vals[groups['2']][0]}
+ attribs = {'x': '%f' % x, 'y': '%f' % y, inkex.addNS('href','xlink'): '#' + quote(vals[groups['2']][0].encode("utf-8"))}
         inkex.etree.SubElement(layer, 'use', attribs)

 def export_BLOCK():

Revision history for this message
hefee (hefee) wrote :
Revision history for this message
hefee (hefee) wrote :
Revision history for this message
Alvin Penner (apenner) wrote :

thanks hefee, this has been tested and committed to rev 21782.

Changed in inkscape:
status: New → Fix Committed
su_v (suv-lp)
Changed in inkscape:
status: Fix Committed → Fix Released
tags: added: importing
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.