CONVERSION LOGIC
Encode SVG as a Data URI
Percent-encode SVG source after a data:image/svg+xml prefix.
SVG sourceSVG Data URIRuns locally
01SVG source
02encodeURIComponent
03SVG Data URI
The complete image can be embedded into a URL-like string.
This implementation uses percent encoding rather than Base64
SVG is text, so a percent-encoded data URI can represent it directly.
Your content stays in the browser
Processing runs locally in the page without requiring the content to be sent to UtilityLake.
02
In short
What exactly does it do?
Percent-encode SVG source after a data:image/svg+xml prefix.
Example?
The complete image can be embedded into a URL-like string.