MarginaGet Margina
記事

公開

What Is Mojibake, and Why Does Your Apostrophe Turn Into ’?

A document lands with ’ where an apostrophe should be, or é where an é belongs. This is mojibake — bytes read with the wrong character encoding. The file is very likely fine; only the last step read it wrong.

What it is

You open a document someone sent you and see ’ where an apostrophe should be. Or é sitting in the middle of a word that should have an é. This is mojibake — text garbled because it was decoded with the wrong character encoding. The bytes in the file haven't changed and almost certainly aren't damaged. Only the last piece of software to open the file guessed wrong about how to read them.

The apostrophe case is the one you'll run into most. A curly right single quotation mark (') is stored in UTF-8 as three bytes: E2, 80, 99. If the app reading the file assumes an older single-byte encoding like Windows-1252 instead, it reads those same three bytes as three separate, unrelated characters — and prints ’ on your screen. Character encoding is just the key that maps bytes to characters. The wrong key gives you the wrong letters, not broken data.

Why it matters

Why plain letters survive but punctuation doesn't

Regular English letters — a through z, A through Z — happen to share the exact same byte values in ASCII, UTF-8, and Windows-1252. That's why a whole paragraph can look fine except for one broken apostrophe or dash. Curly quotes, em dashes, and other "smart" typography live outside that shared range, so they break first when a document's encoding gets guessed wrong. A useful rule of thumb: if only the punctuation looks strange, this is almost certainly what happened, and the words themselves are fine.

The problem compounds if you're not careful

Copy, export, or save an already-garbled document through the same mismatched pipeline again, and the damage stacks. A pound sign that turned into £ can turn into £, then £ — each round adding another layer of misreading. This is one reason the metadata inside your files matters. It's often where the encoding declaration lives, and losing it is what leaves an app guessing in the first place. It's also why UTF-8 has become the practical default everywhere: it now accounts for the overwhelming majority of text on the web, precisely because standardizing on one encoding is what makes the guessing stop.

Where you'll see it

Mojibake shows up most in documents that have passed through more than one piece of software: an old Word file exported years ago, an email thread copy-pasted between different mail clients, an export from a legacy system that never declared its encoding at all. Plain-text documents are especially exposed, because a bare .txt file often carries no encoding label whatsoever. The reading app has nothing to go on but a guess.

It's a close cousin of a problem you may have run into with PDFs. That same "no reliable label, so the software has to infer something" gap is part of why a PDF can render differently on different devices. In both cases, the file itself usually isn't at fault — the rendering step made an assumption the file's creator never confirmed.

So if you see ’, é, or similar strings, don't assume the document is corrupted or that you need to re-request it. In most cases the content is intact, and it's specifically the software reading it that needs to be told — or needs to correctly detect — the right encoding.

How Margina handles it

Margina reads a document's declared or detected encoding directly from the file, rather than assuming a single default for every document you send yourself. It also skips any intermediate conversion step that could re-encode a file incorrectly along the way — fewer hops, fewer chances for this kind of mismatch to sneak in. Moving a document from an older export, or a system you don't fully trust? That's exactly the kind of file worth opening directly in the App Store or Google Play app rather than routing it through several tools first.

Frequently Asked Questions

What does ’ actually mean?

It's the three-byte UTF-8 sequence for a curly apostrophe (') being read one byte at a time by software that assumes an older single-byte encoding like Windows-1252. Nothing is permanently broken at that point — it's a display problem, not data loss, unless the file gets re-saved through the same mismatched pipeline again.

Can I fix mojibake after it happens?

Sometimes, if you know the original encoding: re-decode the garbled text as the wrong encoding, then re-encode it correctly. That can reverse a single round of damage. But if the file's already been re-saved in the garbled state, or garbled more than once, the original bytes are usually gone for good.

Why does this happen more with apostrophes and dashes than regular letters?

Plain unaccented English letters have the same byte values in ASCII, UTF-8, and Windows-1252, so they're unaffected. Curly quotes, em dashes, and other "smart" typography live outside that shared range — they're the first thing to break when an encoding is guessed wrong.

Does this happen with PDFs and EPUBs, or just plain text?

It can happen anywhere text is stored as bytes with an encoding label attached. PDFs, EPUBs, Word docs, and email exports all carry — or fail to carry — that label internally. Plain .txt files are the most exposed, since they often carry no encoding metadata at all, leaving the reading app to guess.

How does Margina avoid this?

Margina reads a document's declared or detected encoding directly from the file rather than assuming one default, and it doesn't round-trip your file through an intermediate format that could re-encode it incorrectly along the way.

Conclusion

Mojibake looks alarming the first time you see it. But it's almost always an interpretation problem, not proof that a file is damaged — the bytes are usually fine, and only the last step misread them. Standardizing on UTF-8 has made this rarer across the web than it was a decade ago. Still, as long as older exports, legacy systems, and undeclared plain-text files exist, you'll run into it occasionally. Now you'll know what you're actually looking at.