Mojibake (文字化け?) (IPA: [mod͡ʑibake]; lit. "character transformation"), from the Japanese 文字 (moji) "character" + 化け (bake, pronounced "bah-keh") "transform", is the garbled text that is the result of text being decoded using an unintended character encoding. The result is a systematic replacement of symbols with completely unrelated ones, often from a different writing system. This display may include the generic replacement character � in places where the binary representation is considered invalid. A replacement can also involve multiple consecutive symbols, as viewed in one encoding, when the same binary code constitutes one symbol in the other encoding. This is either because of differing constant length encoding (as in Asian 16-bit encodings vs European 8-bit encodings), or the use of variable length encodings (notably UTF-8 and UTF-16).
Failed rendering of glyphs due to either missing fonts or missing glyphs in a font is a different issue that is not to be confused with mojibake. Symptoms of this failed rendering include blocks with the codepoint displayed in hexadecimal or using the generic replacement character �. Importantly, these replacements are valid and are the result of correct error handling by the software.
To correctly reproduce the original text that was encoded, the correspondence between two things must be preserved: the encoded data, and the notion of its encoding. As mojibake is the instance of incompliance between these, it can be achieved by manipulating the data itself, or just relabeling it.
Mojibake is often seen with text data that have been tagged with a wrong encoding; it may not even be tagged at all, but moved between computers with different default encodings. A major source of trouble are that rely on settings on each computer rather than sending or storing metadata together with the data.