Why Accented Letters Turn Into é and Other Strange Symbols
When text saved as UTF-8 is read as Windows-1252 or Latin-1, each accented letter turns into two or three odd characters. This is called mojibake. The letter é, stored as the bytes C3 A9, appears as é.
Lookup chart
| Intended | Shows as |
|---|---|
| ó | ó |
| é | é |
| í | Ã |
| ú | ú |
| á | á |
| ü | ü |
| à | Ã |
| è | è |
| ö | ö |
| ô | ô |
| â | â |
| ä | ä |
| æ | æ |
| ç | ç |
| ê | ê |
| ë | ë |
| î | î |
| ï | ï |
| ò | ò |
| ù | ù |
| ý | ý |
| å | Ã¥ |
| ì | ì |
| õ | õ |
| ø | ø |
| û | û |
| ã | ã |
| ð | ð |
| ß | ß |
| ñ | ñ |
| þ | þ |
| ÿ | ÿ |
| š | Å¡ |
| ž | ž |
| č | Ä� |
| ū | Å« |
| ā | Ä� |
| ē | Ä“ |
| ī | Ä« |
| ō | Å� |
How to fix it
- Web pages: add
<meta charset="utf-8">and send aContent-Type: text/html; charset=utf-8header. - Databases: use the utf8mb4 character set in MySQL and make the connection charset match.
- CSV in Excel: import with File origin 65001: Unicode (UTF-8), or save as CSV UTF-8.
- Already broken text: re-encode it as Windows-1252 and decode as UTF-8, for example with the ftfy library in Python.