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

Bug #576126 reported by jasc on 2010-05-05
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Patrick Storz
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) on 2010-07-09
tags: added: encoding metadata
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
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.

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
jazzynico (jazzynico) wrote :
jasc (jasc2002) wrote :

OK, here is my file

su_v (suv-lp) on 2010-09-04
tags: added: win32

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) on 2014-11-03
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
jazzynico (jazzynico) wrote :

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

Changed in inkscape:
status: Confirmed → Triaged
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
jazzynico (jazzynico) on 2017-03-03
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  Edit
Everyone can see this information.

Other bug subscribers