=== modified file 'share/extensions/new_glyph_layer.py' --- share/extensions/new_glyph_layer.py 2011-11-21 20:58:06 +0000 +++ share/extensions/new_glyph_layer.py 2016-02-13 18:43:47 +0000 @@ -19,6 +19,8 @@ import inkex import sys +import locale + class NewGlyphLayer(inkex.Effect): def __init__(self): @@ -27,10 +29,13 @@ 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 @@ 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