What is mojibake

Mojibake is garbled, unreadable text that appears when a computer uses the wrong character encoding to decode text. It happens when text encoded with one system is interpreted by another, leading to symbols being replaced by unrelated ones, often from a different writing system. For example, a single character might be broken into multiple pieces of gibberish, or a phrase can become nonsensical.
 

What causes mojibake?

  • Incompatible character encodings: The most common cause is a mismatch between the encoding used to create the text and the encoding used to display it. 
  • Incorrect parsing: When text is sent from one system to another (like from a database to a web page), the receiving system may not recognize the original encoding and uses a different one to interpret the bytes. 
  • Misinterpreted characters: Some character encodings are single-byte, while others are multi-byte. A multi-byte character can be incorrectly broken into smaller pieces, leading to unreadable gibberish. 
  • Intermittent/Random Double Encoded (presents as mojibake) emojis …1 Aug 2022 — * 2 Answers. Sorted by: Thanks again to @Rick James for his help. The thing that did it for my particular case, where w…Stack Overflow
  • mojibake – encoding issue on winevent logs – Microsoft Q&A3 Dec 2023 — Mojibake is usually caused by incompatibilities between different character encodings. The issue of seeing strange chara…Microsoft Learn

What does mojibake look like?

  • It can appear as a sequence of random, unrelated characters, often from a different alphabet. 
  • It can also result in a specific type of error, like the 锟斤拷 sequence, which is often seen when a system incorrectly interprets UTF-8 encoded data as GBK. 
  • A common example is when the character ‘ö’ (o-umlaut) is misinterpreted, leading to a sequence like ‘ö’ in some cases. 
  • Sometimes, mojibake will display as a diamond-shaped question mark (), which indicates a character couldn’t be rendered at all. 



Leave a Reply