Introduction
When you open a text file and see odd characters, boxes, or nonsense instead of readable words, it’s confusing and a little alarming. Usually these “strange symbols” are not a virus or mysterious message but the result of how computers encode and display text. This article explains why those symbols appear and how to fix or avoid them.
- What happens when text is saved and opened?
- Common encodings and why they matter
- Typical causes of strange symbols
- How different symptoms point to different causes
- Real-world examples and what they mean
- How to diagnose the problem
- How to fix or prevent garbled text
- When text is corrupted beyond easy repair
- Practical tips for everyday users
- Why this still happens despite modern systems
- Further reading and tools
- Conclusion
What happens when text is saved and opened?
Text on a computer is ultimately stored as numbers — sequences of bits that represent characters. A text file contains a sequence of bytes. To turn those bytes back into visible characters, the software that opens the file must interpret them using a character encoding, which is a mapping between numeric values and letters, symbols, or control codes.
If the program reads the file using the same encoding that was used to write it, the displayed text is correct. If the program uses a different encoding, the mapping is wrong and the displayed characters become garbled: unexpected symbols, question marks, empty boxes, or accented letters replaced by odd marks.
Key term: character encoding
A character encoding is a standardized table that tells the computer which number corresponds to which character. Common encodings include ASCII, UTF-8, and ISO-8859-1. Modern systems generally use Unicode (often via UTF-8), but many older files or programs may use legacy encodings.
Common encodings and why they matter
ASCII: One of the oldest encodings, ASCII maps 128 characters (basic English letters, digits, punctuation, and control codes) to values 0–127. ASCII works well for plain English without special punctuation or non-Latin scripts.
ISO-8859 family (Latin-1, Latin-2, etc.): These 8-bit encodings extend ASCII to 256 possible values to include accented letters and characters for specific languages. Different ISO-8859 variants support different language sets.
Windows-1252: A Microsoft extension similar to Latin-1 but with some differences. Many Windows text files created before Unicode became common use this encoding.
Unicode and UTF-8: Unicode is a large character set designed to represent characters used worldwide. UTF-8 is a variable-length encoding of Unicode that is backward-compatible with ASCII and is now the dominant encoding on the web and modern applications.
Typical causes of strange symbols
Mismatched encoding: The single most common cause is that the program opening the file assumes a different encoding than the one used when the file was saved. For example, opening a UTF-8 file as Windows-1252 can produce strange characters for accented text or emoji.
Missing or incorrect metadata: Some file formats include metadata (a header) that states the encoding. Plain .txt files often lack explicit encoding information, so applications must guess. When the guess is wrong, characters display incorrectly.
Legacy files: Older documents created by legacy operating systems or applications might use proprietary or regional encodings. Opening those files in a modern editor that expects UTF-8 often shows garbled characters.
Binary files opened as text: Files that are not text (for example images, compiled programs, or compressed archives) contain arbitrary binary data. When a text editor tries to display that binary data as characters, it shows unreadable or control-character symbols.
Corruption during transfer: If a file was transferred using an inappropriate mode (for example, treating a binary file as text in an FTP transfer) or if the file became corrupted, the byte sequence can change and the text becomes garbled.
Font limitations: Even when the correct encoding is used, the font chosen by the application might not include glyphs for certain characters (for example, rare scripts or emoji). The renderer then displays placeholder boxes, question marks, or fallback glyphs.
How different symptoms point to different causes
Boxes, empty squares, or “tofu”: Usually indicate the font lacks a glyph for those code points. The encoding may be correct, but the system can’t draw the characters.
Replacement characters like � (the Unicode replacement character): Often show when bytes are not valid for the expected encoding (for instance, an invalid byte sequence in UTF-8).
Strange accented letters or punctuation in place of expected characters: Typically a mismatched single-byte encoding (e.g., file saved as Windows-1252 but read as ISO-8859-1 or vice versa).
Mostly gibberish with occasional readable words: This can happen when part of the file uses a different encoding or when the file contains mixed encodings (common in pasted or concatenated content).
Binary-looking output (non-printable control characters): Likely means the file is not a text file at all, or it was compressed/encrypted and opened in a plain text editor.
Real-world examples and what they mean
Example 1 — “— instead of —”: Many text files saved as UTF-8 but opened as Windows-1252 show sequences like — where an em dash (—) should be. That happens because the UTF-8 multi-byte sequence for an em dash is interpreted as separate characters by the single-byte Windows-1252 decoder.
Example 2 — “é” instead of “é”: A common case for accented letters. The two-byte UTF-8 encoding for é (0xC3 0xA9) becomes the characters à and © when misinterpreted as Windows-1252 or Latin-1.
Example 3 — boxes where Chinese or Arabic should appear: This usually indicates the text is correctly encoded in Unicode, but the system font lacks glyphs for that script, so placeholders appear.
Example 4 — random control characters after a file transfer: If a file was transferred between systems using the wrong mode (ASCII vs binary) or with line ending conversions turned on, certain bytes may have been altered, corrupting the encoding.
How to diagnose the problem
Check the file type: If the file extension is not .txt or is known to be binary (like .png, .exe, .zip), don’t open it in a text editor. Opening binary files as text will produce garbage.
Use an editor that can detect or show encodings: Many modern text editors (Notepad++, Sublime Text, VS Code) display or allow you to change the file encoding. Try switching encodings (UTF-8, ISO-8859-1, Windows-1252) to see which one produces readable text.
Look at byte patterns: Advanced editors or hex viewers let you inspect raw bytes. Frequent sequences like 0xC3 0xA9 suggest UTF-8 encoding for é; finding many bytes above 0x7F but single-byte patterns suggests a legacy 8-bit encoding.
Check for a Byte Order Mark (BOM): Some UTF-8 or UTF-16 files include a BOM at the start — a specific sequence of bytes indicating Unicode encoding. A missing or unexpected BOM can cause confusion, and some editors add a BOM while others do not.
Try opening the file in a different program or operating system: Web browsers and modern editors default to UTF-8 and may render text correctly. If one program shows garbled text and another shows correct characters, the issue is likely an encoding mismatch.
How to fix or prevent garbled text
Save and transfer files in UTF-8 when possible: UTF-8 is widely supported and can represent characters from most writing systems. Choosing UTF-8 as a default encoding reduces the chance of mismatches.
Include encoding metadata when the format supports it: Certain file types (HTML, XML, and some rich text formats) allow specifying encoding inside the file. For example, HTML pages can include a meta charset tag so browsers know which encoding to use.
Use editors that preserve encoding and show options: When you open a file in an editor, check or change its encoding before saving. If an editor wrongly guesses the encoding and you save, you may overwrite the correct byte sequence and make recovery harder.
Avoid mixing encodings: Keep a document in a single consistent encoding. Pasting text from sources that use different encodings can create mixed sequences that are hard to correct.
Install fonts for the scripts you need: If you see boxes for particular languages, installing a font that covers that script (or a broad “Noto” or “DejaVu” family font) often resolves the display problem.
Use binary-safe transfer modes when moving files: When transferring files with FTP or similar tools, choose binary mode for non-text files so bytes aren’t altered. For text files, if you must convert line endings, be aware that some conversions can affect encoding.
When text is corrupted beyond easy repair
If a file has been saved with the wrong encoding or overwritten after being opened with the wrong decoder, recovering the original text can be difficult. However, if you still have the original file or a copy, reopen it with different encodings in a capable editor to find one that matches. If the file was corrupted during transfer, restoring from a backup or re-downloading is often the safest route.
For mission-critical documents, keep regular backups and use file formats that include encoding metadata (for example, UTF-8 encoded XML or well-formed HTML). Version control systems can also help you revert to previous correct copies.
Practical tips for everyday users
If you frequently exchange files across different systems, set your text editor or email client to use UTF-8 by default.
When receiving strange symbols in an email or document, try another viewer (web browser or a different editor) before assuming the file is irreparably damaged.
If you are copying text from a website or older document and see odd characters after pasting, try pasting into a plain-text editor that can switch encodings to diagnose the source encoding, then re-save as UTF-8.
For web publishing, always declare the character encoding in HTML and ensure your server sends the correct Content-Type header so browsers interpret pages properly.
Why this still happens despite modern systems
Although UTF-8 and Unicode are widespread, the ecosystem includes legacy files, older software, proprietary formats, and diverse operating systems. People still exchange documents created on older machines or in region-specific encodings. In addition, plain text files typically lack embedded encoding information, so guesswork continues when a program must choose how to render bytes. Finally, font availability varies across devices, so even correctly encoded text can appear as boxes on systems without appropriate fonts.
Further reading and tools
Text editors with encoding options: Notepad++ (Windows), Visual Studio Code (cross-platform), Sublime Text
Hex editors and viewers: HxD, Hex Fiend
Online charset detectors and converters: Tools that let you try different encodings or convert files to UTF-8
Fonts with wide Unicode coverage: Google’s Noto family is designed to cover many scripts and reduce missing-glyph issues
Conclusion
Strange symbols in a text file usually result from a mismatch between the numeric bytes stored in the file and the character encoding the viewer uses to interpret them, or from missing fonts when rendering certain scripts. The simplest remedies are to open the file with an editor that allows selecting encodings, convert files to UTF-8 when appropriate, and ensure fonts supporting the needed scripts are installed. Understanding basic concepts like character encoding, BOM, and the difference between text and binary files helps you diagnose and prevent these issues.

