Wrong Characters in a Text File May Be an Encoding Problem

Illustration of generic cables and devices arranged on a violet desk
AI-generated conceptual illustration, not a product photograph or software screenshot.

A name that should contain an accent opens as several unfamiliar characters. Changing the font may not help, because the problem can occur before a font is chosen: the application may be interpreting the file’s bytes using the wrong character encoding.

Separate characters from their appearance

An encoding connects stored bytes with characters. A font supplies their visual shapes. If the bytes are decoded incorrectly, a beautifully designed font still displays the wrong characters. The MDN character-encoding explanation provides the basic distinction behind this problem.

Preserve the source before experimenting

Keep the original file unchanged. If your editor offers an option to reopen or import using a specified encoding, try it on a copy and compare the result with text you know should be present. Use information from the file’s source where available instead of treating every strange symbol as proof of one particular encoding.

Reopening with a different interpretation is not the same as saving a conversion. Saving already corrupted text can preserve the damage rather than repair it. Read the editor’s prompt carefully before overwriting anything.

Check more than one word

Review accents, punctuation and any non-Latin text across the document. One repaired word does not prove that the entire file has been interpreted correctly. If information was lost earlier in the chain, changing the current setting may not recover it.

This is another example of why changing a filename does not convert a file. A .txt extension says little about the character encoding inside. When asking for help, include the source application, the expected text and a small non-sensitive example of what appeared instead.