Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add charset=utf8 to "Ready for CSS" #9

Open
VictoriaMaksimova opened this issue Dec 19, 2017 · 1 comment
Open

Add charset=utf8 to "Ready for CSS" #9

VictoriaMaksimova opened this issue Dec 19, 2017 · 1 comment

Comments

@VictoriaMaksimova
Copy link

Hi!
Thank you for a nice tool :)

For IE it's important to add 'charset=utf8' for background-image property like this
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E");
If you don't do this, the image will not be displayed.

It would be nice to add charset automatically, what do you think?

@HatScripts
Copy link

Which IE versions is this needed for?

According to Taylor Hunt's blog post, Optimizing SVGs in data URIs, which references RFC 2397:

The best way of encoding SVG in a data: URI is data:image/svg+xml,[actual data]. We don’t need the ;charset=utf-8 parameter (or the invalid ;utf8 parameter in the first example), because the given SVG is ASCII.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants