Skip to content
Utilboxes

Why text shows ’, é or � instead of apostrophes and accents

Garbled characters like ’ and é appear when UTF-8 text is read with the wrong encoding. What causes it, how to fix the file, and how to stop it recurring.

Published

Tools for this job: Text Cleaner · Character Counter · URL Decoder

Sequences like ’ or é appear when text saved as UTF-8 is opened as an older encoding such as Windows-1252. Each accented letter or curly quote is stored as two or three bytes, and the wrong decoder shows each byte as its own character. The fix is to reopen the text as UTF-8, not to edit the symbols by hand.

What the garbage tells you

The pattern, sometimes called mojibake, is consistent enough to read backwards:

  • ’ was a curly apostrophe (’). “ and †were curly double quotes. – and — were dashes.
  • é was é, è was è, ü was ü, ñ was ñ.
  •  appearing before a space or symbol, as in “£” or “price: 10”, was a non-breaking space or a symbol like £.
  • �, the replacement character, means the reader hit bytes that were not valid in the encoding it was using. That can mean the opposite mistake: older-encoded text opened as UTF-8.

Why one character becomes two or three

Older encodings such as Windows-1252 or ISO-8859-1 store every character in a single byte, which limits them to 256 characters. UTF-8 can store every character in every language by using one byte for plain English letters and two to four bytes for everything else. Plain ASCII text looks the same in both, which is why the problem hides until an apostrophe, a pound sign or a name like José appears. A program that wrongly assumes single bytes then prints each byte of é — C3 and A9 — as the two characters those bytes mean in its table: Ã and ©.

Where it happens

  • Opening a CSV in Excel by double-clicking. Excel may assume your system’s legacy encoding unless the file starts with a byte-order mark.
  • Copying between systems — a database, an old CMS, an email template — where one side declares the wrong encoding.
  • Web pages whose server or HTML declares one encoding while the file is saved in another.
  • Text that was garbled twice, producing longer runs like ’. Each round of misreading adds a layer.

How to fix it

Reopen with the right encoding

  • Excel: instead of double-clicking, use Data → From Text/CSV, and choose 65001: Unicode (UTF-8) as the file origin. The preview updates immediately.
  • Text editors: most have a “Reopen with encoding” or “Encoding” menu. Choose UTF-8. Then save the file as UTF-8 so it stays fixed.
  • Web pages you control: save files as UTF-8, put <meta charset="utf-8"> near the top of the head, and make sure the server sends charset=utf-8 in its Content-Type header.

If you only have the garbled text

When the original file is gone, a short find-and-replace for the patterns above repairs most English text: ’ → ’, “ → “, é → é and so on. Do the longest sequences first. Programmers can reverse it exactly by encoding the text back to Windows-1252 bytes and decoding those bytes as UTF-8.

Afterwards, the Text Cleaner can straighten the restored curly quotes into plain ones and strip leftover invisible characters such as stray non-breaking spaces, which is often the safest form for systems that mishandle encodings. The Character Counter shows the byte count next to the character count — if a short line is far more bytes than characters, it still contains multi-byte characters.

A related case: %C3%A9 in web addresses

Text like caf%C3%A9 is not garbled; it is the same UTF-8 bytes written as URL percent-escapes. The URL Decoder turns it back into café.

Prevent it

  • Use UTF-8 everywhere: files, databases, HTML, email templates and exports.
  • Import CSVs into Excel through Data → From Text/CSV, not by double-clicking.
  • When pasting into old systems that cannot handle UTF-8, convert smart quotes to straight first.

Checklist

  • Original file reopened as UTF-8, not edited by hand?
  • Saved back as UTF-8?
  • Encoding declared consistently by server, page and database?

Tools used in this guide

More tools for this job

All guides