xcf export fails if file or layer names contain non-ASCII characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Inkscape |
Low
|
jazzynico |
Bug Description
XCF export seems to fail when spaces or special non-US-ASCII characters are used for the name of layers or file.
My locale is spanish, where the use of accented vowels and ñ is very common, and that's what appears to keep the xcf export script from working correctly.
In 0.48.4 it just does nothing (it doesn't save anything and it doesn't show any error messages in the UI or the console).
In 0.48+devel an error message is displayed:
Traceback (most recent call last):
File "gimp_xcf.py", line 271, in <module>
e.affect()
File "/opt/inkscape-
self.effect()
File "gimp_xcf.py", line 235, in effect
f.write(
UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in position 1351: ordinal not in range(128)
The workaround is very easy, it's only matter of changing the name of the offending elements removing all non-ascii characters, and the file is created properly.
Related branches
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: | added: exporting layers xcf |
tags: | removed: layers |
description: | updated |
Changed in inkscape: | |
status: | Confirmed → Triaged |
assignee: | nobody → JazzyNico (jazzynico) |
jazzynico (jazzynico) wrote : | #3 |
Patch tested on Crunchbang Waldorf (Debian stable), Inkscape trunk revision 12710.
Changed in inkscape: | |
status: | Triaged → In Progress |
milestone: | none → 0.49 |
jazzynico (jazzynico) wrote : | #4 |
Also tested successfully on Windows XP, and committed revision 12715.
Changed in inkscape: | |
status: | In Progress → Fix Committed |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Hachmann (marenhachmann) wrote : | #5 |
This still happens in trunk for me (and in 0.91).
Should this report be reopened? Or does it qualify as a regression?
Traceback (most recent call last):
File "gimp_xcf.py", line 284, in <module>
e.affect()
File "/usr/share/
self.effect()
File "gimp_xcf.py", line 248, in effect
f.write(
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 697: ordinal not in range(128)
Hachmann (marenhachmann) wrote : | #6 |
(The offending layer was named 'Hände', as reported in the German forum here: https:/
jazzynico (jazzynico) wrote : | #7 |
@Maren - This is indeed a regression (introduce when trying to fix the current report...).
A patch is in progress.
Thanks!
jazzynico (jazzynico) wrote : | #8 |
Follow-up report: bug #1633999 "xcf export fails if layer names contain non-ASCII characters".
Hachmann (marenhachmann) wrote : | #9 |
Thank you! I'll pass on the good news to the user in the forum, too :)
Reproduced with Inkscape 0.48+devel r12415 on OS X 10.7.5, Python 2.7.5, GTK+/Quartz 2.24.19:
exporting of the provided sample SVG file to GIMP XCF (GIMP 2.8.6 installed) fails with this error message:
Traceback (most recent call last): magenta/ mp-trunk/ src/inkscape- repo/mptrunk- quartz/ inst/share/ inkscape/ extensions/ inkex.py" , line 267, in affect script_ fu)
File "gimp_xcf.py", line 271, in <module>
e.affect()
File "/Volumes/
self.effect()
File "gimp_xcf.py", line 235, in effect
f.write(
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0301' in position 1832: ordinal not in range(128)