Jump to content

SVG file not supported


Recommended Posts

Hi everyone,

 

I am trying to open an SVG file I exported from Blender.

The file opens fine in other SVG applications. I can even drag and drop on a chrome browser and it loads it fine.

Affinity Designer, however, will not open and shows a dialogue box "Failed to open file: The file type is not supported".

Is there a solution for this?

 

Best,

James

test.svg

Link to comment
Share on other sites

Welcome to the forums.

Try editing the SVG file in a text editor and change (at the top)
encoding='ascii'
to
encoding='utf-8'
then save the file and place it in your document.
Blender may have an option to make this a default export setting.

P.S. Your forum name should not be an email address. Spammers can take it and use it.

Screenshot 2021-02-03 100759.png

Link to comment
Share on other sites

4 minutes ago, GarryP said:

Try editing the SVG file in a text editor and change (at the top)
encoding='ascii'
to
encoding='utf-8'
then save the file and place it in your document.
Blender may have an option to make this a default export setting.

So is this a bug? Or just an oversight? Inkscape, Illu and Krita open the original file without a problem.

------
Windows 10 | i5-8500 CPU | Intel UHD 630 Graphics | 32 GB RAM | Latest Retail and Beta versions of complete Affinity range installed

Link to comment
Share on other sites

The Affinity SVG parser doesn't support all XML encodings, in this case "ascii" and thus ommits the whole. - See for example XML encoding ...

Quote

Definition of XML Encoding

XML Encoding is defined as the process of converting Unicode characters into binary format and in XML when the processor reads the document it mandatorily encodes the statement to the declared type of encodings, the character encodings are specified through the attribute ‘encoding’. Encoding plays a role in XML as the user needs to provide a correct encoding while transferring XML Documents on different platforms. With respective to XML 1.0 specification, the two Unicode UTF -8 and 16 must be supported in the processor automatically. XML parser encodes the document properly and translate them into standard Unicode internally.

...

Quote

Syntax of XML Encoding

This Unicode character set has a universal character that covers a major part of the world languages. To lead a better interaction with methods of encoding characters this Unicode gives us the specification. The encoding part is declared in the section of the XML document LINE1. The general Syntax of Unicode is given below:

<?xml version="1.0" encoding="encoding-name”?>

UTF-8 Syntax

<?xml version = "1.0" encoding = "UTF-8" standalone = "no" ?>
-          It’s a pure ASCII character.

UTF-16 Syntax

If suppose a document includes a Unicode like (0XX…) they are considered to be UTF-16 encodings with 16bits.

<?xml version = "1.0" encoding = "UTF-16" standalone = "no" ?>

The encoding attribute names are not case-sensitive as they proceed ISO and IANA standards.

For Western European Character set the declaration is as follows as they use non-English characters (Latin-1).

<xml version="1.0" encoding="ISO-8859-1" >

Xml also recognizes different encodings like US-ASCII, ISO-8859-1 to 10 and windows version. The general annotation of XML declaration with valid encodings name are given below:

<?xml version='1.0' encoding='US-ASCII' standalone='yes’?>
<?xml version='1.0' encoding='ISO-10646-UCS-2’?>
<?xml version='1.0' encoding='ISO-8859-1’?>
<?xml version='1.0' encoding='Shift-JIS’?>


By default (with no encoding specified) UTF-8 is allowed to assume in the header of the XML file and this is used by the XML Parser.

How does Encoding Work in XML?

To avoid errors while working with XML it is necessary to specify the type of encoding or the XML file should be saved as Unicode. Different types of character encodings are provided while specifying any foreign languages which fall beyond the standard encoding scope. In some cases, the XML processor ignores encoding attributes in the XML Declaration when it is passed through the other network protocols as HTTP has specific headers for the encoding provided actual encoding should be the same as a specific encoder or else it shows the error. The Encoding given in the XML declaration could be overridden by HTTP Protocols during data transfer. The function XMLGetEncoding() helps to do the encoding process.

Format: XMLGetEncoding(generation, I/O entry)

  • generation is the task generation, 0 for the current task, 1 for the parent, and so on.
  • I/O entry defines the number of input/output file that has the XML document.
  • It gives a text box which is the value of the “encoding” attribute on the XML document.

 

☛ Affinity Designer 1.10.5 ◆ Affinity Photo 1.10.5 ◆ OSX El Capitan

Link to comment
Share on other sites

  • 1 month later...

Assuming that Serif want to change/enhance this functionality, we cannot expect an update but we can hope for one.
Serif do not normally – for various good and understandable reasons – tell us about their future plans until we see what’s in the betas.
(As you can see from the link given by v_kyr, this was mentioned in a bug report in 2017.)

Since ASCII seems to be an unusual encoding for SVG you could ask the people who created the functionality in Blender why they chose that encoding and whether they could give you the option to use UTF-8 instead. (“Two sides to every story.”)

Link to comment
Share on other sites

  • 9 months later...

I bought the affinity package, but I find my self using inkscape more because of the inability to work with blender. I too find it odd that blender's svg can open so easily in any other svg editor or browser, but affinity. By the time I open it in inkscape and save it again from inlscape to svg, then open it in affinity I just stay in inkscape.

I don't regret getting the affinity suit I just hope this feature is added soon

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

Please note there is currently a delay in replying to some post. See pinned thread in the Questions forum. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.