Skip to main content
Parts4Arts
Inspiring
August 11, 2021
Answered

Names of objects are changed when exporting to SVG

  • August 11, 2021
  • 1 reply
  • 374 views

I noticed that AI CC version 25.4.1 (macOS 11.4 German) changes the names of objects in SVG.

 

Example: A rectangle with the name "(BG)" becomes <g id="_x28_BG_x29_"> in the exported SVG.

_xNN_ looks like Unicode when NN are two decimal numbers. So the two brackets become _x28_ and _x29 respectively.

Unfortunately, I found that there is no system. Because a colon ":" or "." remains a dot in SVG.

Other special characters like π -> &#x3C0; or Ä -> &#xC4; become real unicodes.

 

Where can I find a list of which characters are translated and how?

And why is that necessary at all? In Inkscape, an SVG element can also be called (BG) with real brackets.

 

– Jens

This topic has been closed for replies.
Correct answer Test Screen Name

Adobe is just following the rules of SVG.  In simple language  "A stand-alone SVG document uses XML 1.0 syntax, which specifies that valid IDs only include designated characters (letters, digits, and a few punctuation marks), and do not start with a digit, a full stop (.) character, or a hyphen-minus (-) character." (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/id)

 

In highly technical language see https://www.w3.org/TR/xml/#NT-Name

 

Ignoring the many Unicode characters allowed in IDs, this means

Start with a-z A-Z _ :

Continue with a-z A-Z 0-9 _ : . -

You could report this as a bug in Inkscape.

1 reply

Test Screen NameCorrect answer
Legend
August 12, 2021

Adobe is just following the rules of SVG.  In simple language  "A stand-alone SVG document uses XML 1.0 syntax, which specifies that valid IDs only include designated characters (letters, digits, and a few punctuation marks), and do not start with a digit, a full stop (.) character, or a hyphen-minus (-) character." (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/id)

 

In highly technical language see https://www.w3.org/TR/xml/#NT-Name

 

Ignoring the many Unicode characters allowed in IDs, this means

Start with a-z A-Z _ :

Continue with a-z A-Z 0-9 _ : . -

You could report this as a bug in Inkscape.

Parts4Arts
Inspiring
August 12, 2021

Hello and thank you for the background information. It is sometimes difficult to search for something like this if you don't know the right search term.
Kind regards, Jens.