summaryrefslogtreecommitdiffstats
path: root/share/extensions
diff options
context:
space:
mode:
authorme-kell <>2016-03-20 08:26:47 +0000
committerJazzyNico <nicoduf@yahoo.fr>2016-03-20 08:26:47 +0000
commitb7b077d0aedeb7e1e808c927f15b1f1314ae4b85 (patch)
treeb2c9d73eabb7ebcc92dbdf40c7a9346c696053fd /share/extensions
parentAdd Shift+Enter path complete and larger square node on mouse over. (diff)
downloadinkscape-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-xshare/extensions/new_glyph_layer.py9
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