I have this code (degree symbol encoded as HTML):
<a download="text.txt" href="data:text/plain,°">Download degree symbol</a>
What I do
°
, instead of the expected °
(When I do a hex dump I get b0c2
)How do I fix this?
My context is I have a PHP-encoded $string = "°"
. but for purposes of this example I stripped it down and inserted degree into HTML link directly. I tried using utf8_decode()
with same results as above.
I need to open the resulting file in a legacy Windows application that seems to read ASCII only (aka displays °
like above and I need to only have it display the degree symbol).
Courtesy of ... cor-el of Mozilla Support, use this:
data:text/plain;charset=iso-8859-1,%b0