diff options
| author | me-kell <> | 2016-03-20 08:26:47 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2016-03-20 08:26:47 +0000 |
| commit | b7b077d0aedeb7e1e808c927f15b1f1314ae4b85 (patch) | |
| tree | b2c9d73eabb7ebcc92dbdf40c7a9346c696053fd /share/extensions | |
| parent | Add Shift+Enter path complete and larger square node on mouse over. (diff) | |
| download | inkscape-b7b077d0aedeb7e1e808c927f15b1f1314ae4b85.tar.gz inkscape-b7b077d0aedeb7e1e808c927f15b1f1314ae4b85.zip | |
[Bug #1518302] Extension new_glyph_layer (Typography) not using decoding properly.
Fixed bugs:
- https://launchpad.net/bugs/1518302
(bzr r14722)
Diffstat (limited to 'share/extensions')
| -rwxr-xr-x | share/extensions/new_glyph_layer.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/share/extensions/new_glyph_layer.py b/share/extensions/new_glyph_layer.py index 7261baa2d..d6622cc62 100755 --- a/share/extensions/new_glyph_layer.py +++ b/share/extensions/new_glyph_layer.py @@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import inkex import sys +import locale + class NewGlyphLayer(inkex.Effect): def __init__(self): @@ -27,10 +29,13 @@ class NewGlyphLayer(inkex.Effect): action="store", type="string", dest="unicodechars", default='', help="Unicode chars") + self.encoding = sys.stdin.encoding + if self.encoding == 'cp0' or self.encoding is None: + self.encoding = locale.getpreferredencoding() def effect(self): # Get all the options - unicode_chars = self.options.unicodechars + unicode_chars = self.options.unicodechars.decode(self.encoding) #TODO: remove duplicate chars @@ -40,7 +45,7 @@ class NewGlyphLayer(inkex.Effect): for char in unicode_chars: # Create a new layer. layer = inkex.etree.SubElement(svg, 'g') - layer.set(inkex.addNS('label', 'inkscape'), 'GlyphLayer-'+char) + layer.set(inkex.addNS('label', 'inkscape'), u'GlyphLayer-'+char) layer.set(inkex.addNS('groupmode', 'inkscape'), 'layer') layer.set('style', 'display:none') #initially not visible |
