extension new_glyph_layer (Typography) not using decoding properly

Bug #1518302 reported by me-kell
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
me-kell

Bug Description

Entering non-ascii characters raises a ValueError (see detailed description in https://answers.launchpad.net/inkscape/+question/263246).
This (as explained there) is because Python environment as passed by Inkscape's extension mechanism has no PYTHONIOENCODING variable and Python wrongly guesses the encoding "cp0".

Proposed solution:

Use "sys.stdin.encoding" and if it is "cp0" or "None" use "locale.getpreferredencoding()" (see detailed explanation in https://answers.launchpad.net/inkscape/+question/263246).

See patch in attachment

Revision history for this message
me-kell (me-kell) wrote :
Revision history for this message
jazzynico (jazzynico) wrote :

Patch tested successfully on Windows XP, Inkscape trunk rev. 14495.

Changed in inkscape:
assignee: nobody → me-kell (me-kell)
importance: Undecided → Low
milestone: none → 0.92
status: New → In Progress
Revision history for this message
Hachmann (marenhachmann) wrote :

Yay! Thanks, me-kell + jazzynico :)

Revision history for this message
su_v (suv-lp) wrote :

Patch doesn't work on OS X (tested with locale 'en_US.UTF-8'; Python 2.7.10) - Python tracebacks attached as text file (to avoid line breaks in normal comments).

Revision history for this message
su_v (suv-lp) wrote :

The attached modified version of the patch works for me (on osx).

Revision history for this message
su_v (suv-lp) wrote :

… and the diff between the two patches (in case it helps reviewing …).

Revision history for this message
jazzynico (jazzynico) wrote :

New patch from ~suv in comment #6 tested successfully on Windows XP (32-bit), Inkscape trunk rev. 14718.
If nobody objects, I'm going to commit it soon.

Revision history for this message
jazzynico (jazzynico) wrote :

Patch v2 also tested successfully on Xubuntu 15.10.
Committed in the trunk rev. 14722.

Changed in inkscape:
status: In Progress → Fix Committed
tags: added: backport-proposed
Revision history for this message
Martin Owens (doctormo) wrote :

These patches are already in 0.92.x

tags: removed: backport-proposed
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
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.