• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 402
  • Last Modified:

Cannot load SVG file into Inkscape

I have opened and edited an SVG file that was created by Inkscape (www.inkscape.org) in Notepad.

After saving the result, I cannot load it back into Inkscape. I was very careful that I saved it as UTF-8. I also checked that all <>'s and ""'s matched.
When loading the file into Inkscape I get the message "Failed to load the selected file <FILE>". Adobe Illustrator just shows an empty page. In Firefox the file loads, but with the wrong fonts, but that's normal.

In Inkscapes log file, it only says: "Failed to load the selected file <FILE>"
Thanks, that really helps. >>;-E

I just have no idea what I did wrong. Do you have any idea?

1 Solution
This problem is caused by a feature of Notepad. When you save as UTF-8, it adds a BOM header to the file, but Inkscape, among lots of other programs,  doesn't like this header. This is not really a bug per se, just a side effect of using Notepad to edit something other than plain text. SVG files are a tagged file format, and the BOM header is only required in untagged files, where the document itself doesn't contain information about the encoding used. The BOM isn't necessary for SVG files saved by Inkscape, because the UTF-8 encoding is specified in the XML header. If you have a hex editor, open the file up, and you'll see the BOM as a couple of bytes at the beginning of the file. They're invisible in notepad, but they're there.

Maybe this should be brought to the attention of the Inkscape developers, I dunno.

More info...



Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now