[Windows] cannot open file with non-ASCII chars in Save-as Title field

Bug #576126 reported by jasc
62
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Patrick Storz
0.92.x
Fix Released
Medium
Patrick Storz

Bug Description

- when saving a file (Inkscape SVG format) I put some text in my language (Central European - Polish, win-1250) in Title field
- by reopening this file I receive error message like (preview is not available too): the file cannot be opened = all my work is gone :)
- after replacing non-latin characters by hand in <title id="title2816"> and <dc:title> tags in SVG - I can open file again

- I see, the chars looks like non properly coded in UTF-8 - as stated in first line of file
- non-ASCII chars in filemane making no problem (tested)
-----
Windows XP SP3, Polish, Inkscape 0.47 (PortableApps)

su_v (suv-lp)
tags: added: encoding metadata
Revision history for this message
Jon A. Cruz (jon-joncruz) wrote :

Can you compress (.zip) a small sample svg with the problem and attach to the bug?

Changed in inkscape:
status: New → Incomplete
Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Windows XP, Inkscape 0.47 and r9535.

The text added to the svg title and metadata title elements is not encoded to UTF8.

Workarounds:
1. Replace <?xml version="1.0" encoding="UTF-8" standalone="no"?> with <?xml version="1.0" encoding="Iso-8859-1" standalone="no"?> in the SVG file. If you save the file again, the encoding is reset to UTF-8 but the titles are correctly encoded.
2. Remove the title elements values in the SVG file.
3. Use the Metadata dialog to set the title instead of the title field in the Save as dialog.

Changed in inkscape:
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
jazzynico (jazzynico) wrote :
Revision history for this message
jasc (jasc2002) wrote :

OK, here is my file

su_v (suv-lp)
tags: added: win32
Revision history for this message
Thomas W. (t-launchpad-net-2012-09-06) wrote :

I'm having the same problem here. I cannot even open the file again with Inkscape.
Inkscape: 0.48.2r9819
Windows 7 64 Bit

My Workaround:
open file in Notepad++, convert to UTF-8 including byte order marks.
After that, I can open the file. It displays the title correcly in the metadata window, but not in SaveAs dialog.

su_v (suv-lp)
summary: - [win XP] cannot open file with non-ASCII chars in Save-as Title field
+ [Windows] cannot open file with non-ASCII chars in Save-as Title field
Revision history for this message
jazzynico (jazzynico) wrote :

Warning message:
  Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()

Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
Patrick Storz (ede123) wrote :

This patch should fix the encoding issue with the native Windows file save dialog.

It's a bit messy as we have to convert back and forth:
- Title from metadata in document properties is UTF8 encoded
- The file save dialog used Windows Unicode (UTF16)
- The target file is again UTF8 encoded

Please test if this works consistently.

On Windows 10 x64 with Inkscape 0.92.x r15396 this patch fixes the issue (system code page: ISO 8859-15, but should hopefully not matter)

Changed in inkscape:
assignee: nobody → Eduard Braun (eduard-braun2)
status: Triaged → In Progress
Revision history for this message
Patrick Storz (ede123) wrote :
Changed in inkscape:
status: In Progress → Fix Committed
jazzynico (jazzynico)
Changed in inkscape:
milestone: none → 0.93
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.