extension new_glyph_layer (Typography) not using decoding properly

Bug #1518302 reported by me-kell on 2015-11-20
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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

me-kell (me-kell) wrote :
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
Hachmann (marenhachmann) wrote :

Yay! Thanks, me-kell + jazzynico :)

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).

su_v (suv-lp) wrote :

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

su_v (suv-lp) wrote :

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

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.

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
Martin Owens (doctormo) wrote :

These patches are already in 0.92.x

tags: removed: backport-proposed
Bryce Harrington (bryce) on 2017-01-10
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers