The mojibake “creëer”
Posted by jpluimers on 2024/08/22
A while ago, I found the “creëer” mojibake in a Dutch page on the IKEA site.
They were not alone to make this mistake which is easily explained using [Wayback/Archive] ftfy:
>>> ftfy.fix_and_explain("creëer") ExplainedText(text='creëer', explanation=[('encode', 'latin-1'), ('decode', 'utf-8')])
(you can run this on-line at [Wayback/Archive] Welcome to Python.org: interactive shell, see my post The things I didn’t notice during cancer survival: ftfy 6.0 and more versions got released during my recovery on how to do this)
So the text is easily fixed:
>>> s="creëer" >>> s.encode('latin-1') b'cre\xc3\xaber' >>> s.encode('latin-1').decode('utf-8') 'creëer'
Encoding isn’t hard, you just have to be aware of storage and various transcoding steps taking place in your development and operation stacks, in this case mixing Latin-1 (ISO/IEC 8859-1) and UTF-8.
Related
- [Wayback/Archive] “creëer” – Google Search
- [Wayback/Archive] Poten en schragen – IKEA
- [Wayback/Archive] Jeroen Wiert Pluimers on Twitter: “A nice “creëer” #Mojibake #encoding #unicode issue introduced by @IKEANederland See
gist.github.com/jpluimers/19777107b1cfec4cdc972eb813520719for URL and page source.” - [Wayback/Archive] Jeroen Wiert Pluimers on Twitter: “@IKEANederland Found via
google.com/search?q=ikea+tafelpoten+voor+buiten“ - [Wayback/Archive] Home – ftfy: fixes text for you
--jeroen
https://gist.github.com/jpluimers/19777107b1cfec4cdc972eb813520719






Leave a Comment