Don’t escape+unescape characters in SVG download

Authored by Lucas_Werkmeister_WMDE on Oct 27 2017, 3:24 PM.

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.


Don’t escape+unescape characters in SVG download

encodeURIComponent turns special characters into percent sequences for
the UTF-8 encoding of the characters, and unescape turns those
individual escape sequences into the direct byte value, so we end up
with UTF-8 in the string. downloadjs then re-encodes that UTF-8, so we
end up with double UTF-8 in the downloaded file. As far as I can tell,
this is completely unnecessary, and we can just pass the string as-is to
downloadjs and have it deal with UTF-8 on its own.

Bug: T178564
Change-Id: I9a526fc8b4f127cc300db6651a108bc30e087c9c