3 ms·
> has what looks like interpreting Windows-1252 as Unicode The other way around. The underlying data is UTF-8; it's being misread as either latin1 or Windows-1
by deathanatos 8y ago
> has what looks like interpreting Windows-1252 as Unicode
The other way around. The underlying data is UTF-8; it's being misread as either latin1 or Windows-1252. E.g., "Pérez",
Original string: "Pérez"
Encoded as UTF-8: b'P\xc3\xa9rez'
Those bytes, erroneously decoded as latin1: "Pérez"
https://en.wikipedia.org/wiki/Mojibake https://en.wikipedia.org/wiki/Mojibake
These two (latin1 and Win-1252) are the most common mis-decoding. UTF-8 data is common. HTML/HTTP/the "text/*" mimetype default to latin1. Windows, for North American users, defaults to Win-1252 in places. (Both encodings are extremely similar.)
It used to be that if you typed "Québec" into Google, it'd give you Québec, and wouldn't even issue a "did you mean?", just silently corrected it. Seems like that's not the case anymore. Back when it was, I wondered if the "machine" thought that Québec was an alternative spelling. (The results for "Québec" are still decently relevant.)