Parsing and encoding
The SVG is handled as plain text, not rendered: the markup is normalized first, with the XML declaration and comments removed and runs of whitespace collapsed so the whole drawing fits on one line. The encoding pass then replaces every character that is unsafe inside a URI with a percent escape - angle brackets, double quotes, the hash sign (the one that breaks colors), spaces and any literal % - while letters, digits, /, :, - and . stay readable as-is.