Recent chats
ASKGEEZ Q&A GUIDETechnology & devices

Why does opening text with the wrong encoding produce garbled characters?

Quick answer

Text is stored as bytes, and a character encoding defines how those bytes map to characters. If software decodes the bytes using an incompatible encoding, the displayed characters may be wrong—a symptom often called mojibake. Compare the underlying text with the same bytes decoded using the intended encoding. If the characters are correct but their visual forms are missing or substituted, investigate font coverage or rendering instead. [S1] [S2]

LET’S WORK THROUGH IT

The question, the details, the next step.

Question

Why can a file look fine in one place but turn into strange symbols when I open it somewhere else?

Geez

A text file contains bytes; an application has to interpret those bytes as characters. Character encoding defines that mapping. If the application uses an incompatible encoding, the resulting characters can be incorrect, producing garbled-looking text often called mojibake. [S1]

So the key question is whether the text was interpreted incorrectly, or whether the correct characters are present but cannot be displayed properly. A different app or setting may help you compare those possibilities, but the garbled appearance alone does not establish the cause. If you still have the original file, keep an unchanged copy while investigating.

Follow-up question

How do I tell an encoding mismatch apart from a font problem?

Geez

Look at the underlying characters, not only their appearance. If they are themselves the wrong characters—rather than the intended letters or symbols—a decoding mismatch is a plausible cause. Compare the same bytes using the known intended encoding; if that produces the expected characters, it supports that explanation. [S1]

If the underlying characters are correct but some appear as empty boxes, substitutes, or otherwise unsuitable visual forms, investigate font coverage or rendering. A glyph is a visual representation of a character, and fonts contain different sets of glyphs. [S1] [S2] These clues help narrow the search; they do not guarantee a diagnosis for every application or file.

Follow-up question

What should I check first, and what if I don’t know the intended encoding?

Geez

Start by recording what you observe and where: note the file or text, the application, whether the problem affects all text or only some characters, and what you expected to see. Then compare the same content in another viewer or with another available encoding option, changing one thing at a time. The useful comparison is the same bytes interpreted under the known intended encoding—not just a different-looking display. [S1]

If you do not know the intended encoding, avoid treating a guess as a confirmed fix. Check whether the text’s creator or the application that produced it can identify the encoding, if that information is available. If you cannot establish it, record that uncertainty and preserve the original so later comparisons remain possible.

Follow-up question

Can you show me how to record a useful example and turn it into a short troubleshooting note?

Geez

Here is a hypothetical example. Suppose a file is expected to show “café,” but one application displays different, unintended characters. That visible change is consistent with an encoding mismatch, but the example alone does not prove which encoding was intended. Compare the underlying text from the same bytes using the known intended encoding. If instead “café” is the underlying text and only the accent appears as a box or substitute, check whether the font or rendering can show the needed glyph. [S1] [S2]

You can copy and fill in this note:

“Expected text: [what I should see]. Observed text: [what appears]. File or source: [name or description]. Application: [name]. Scope: [all text / selected characters / other]. Comparison tried: [same content and what changed]. Intended encoding: [known value / unknown]. Underlying characters appear: [correct / incorrect / unsure]. Next question: [what information or comparison is still needed].”

Keep observations separate from conclusions: write “possible encoding mismatch” rather than labeling it confirmed unless the comparison supports that conclusion.

A practical checklist

  • Record the expected text and the exact characters or symbols that appear instead.

  • Note which file or source and which application show the problem.

  • Check whether all text is affected or only particular characters.

  • Compare the same bytes using the known intended encoding, if it is available.

  • If the underlying characters are correct but their forms are missing or substituted, investigate font coverage or rendering.

  • Mark the cause as uncertain when the intended encoding or underlying text cannot be established.

A few more useful answers

Does garbled text prove that the file’s encoding is wrong?

No. Mojibake is a symptom associated with incorrect character-set interpretation, but appearance alone does not establish the cause. Compare the underlying text and, if possible, the same bytes interpreted with the known intended encoding. [S1]

Can a font issue make characters look wrong even when the text is correct?

Yes. Fonts contain different sets of glyphs, which are visual representations of characters. If the underlying characters are correct but their forms are missing or substituted, font coverage or rendering is worth investigating. [S1] [S2]

What if I cannot find out which encoding was intended?

Record the expected and observed text, the application, and what comparisons you tried. Treat any proposed encoding as a hypothesis rather than a confirmed fix until you can compare against reliable information about the intended encoding.

Sources

References used for this guide.

  1. [S1] Character encoding — MDN Glossary
    developer.mozilla.org · Checked
  2. [S2] Glyph — MDN Glossary
    developer.mozilla.org · Checked

YOUR QUESTION. YOUR DETAILS.

Let’s work through your situation.

Get a tailored answer or help with your next task. Starts at $1, with a quote before you pay.

Ask your own question
← Back to Geez at Work