5 ms·
The single quot for doesn't is an ASCII character though, why does that one become ’?
by Aardwolf 5y ago
The single quot for doesn't is an ASCII character though, why does that one become ’?
- iudqnolq 5y agoHere's the heuridtic-based hypothesis of the python package ftfy >>> ftfy.fix_and_explain("’") ExplainedText( text="'", explanation=[ ('encode', 'sloppy-windows-1252'), ('decode', 'utf-8'), ('apply', 'uncurl_quotes') ] )
- wolfgang42 5y agoNote that uncurl_quotes is a FTFY fix unrelated to character encoding, it’s basically just s/’/'/. (FTFY turns all of its fixes on by default, which sometimes results in it doing more than you might want it to.) You can play around with FTFY here (open the “Decoding steps” to see the explanation of what it did and why): https://www.linestarve.com/tools/mojibake/?mojibake=’ https://www.linestarve.com/tools/mojibake/?mojibake=’
- deleted 5y ago[deleted]
- iudqnolq 5y agoThanks!
- bdowling 5y agoIt's not. It's a Unicode 'RIGHT SINGLE QUOTATION MARK' (U+2019), which in UTF-8 is encoded as 0xe2 0x80 0x99. 0xe2 is â in iso8859-1. 0x80 is not in iso8859-1, but is € in windows-1252. 0x99 is not in iso8859-1, but is ™ in windows-1252. So, the browser here appears to be defaulting to windows-1252.