keepcalculator

06 Numbers and Powers

Question Marks Instead of Letters: Causes & Fixes

Card No. 06·37889 · Updated · Standard formula, shown below

Average pace 5.00 min/km
Average speed
12.00 km/h
Result
Finish time
50 min
You entered
Distance
10 km
You entered
You enter
Finish time, Distance
You get
Average pace, Average speed
Rounding
2 dp

The question marks you see instead of letters are almost always a character encoding mismatch: the file or text was saved in one encoding, but the program displaying it is reading it as another. This happens because computers store text as numbers, and each encoding maps those numbers to different characters; when the mapping is wrong, the program sees a number it doesn’t recognize and shows a placeholder like “?” or “�”.

Formula

This calculator computes your average pace and speed from a finish time and distance. The formulas are:

Pace (min/km) = Finish time (min) ÷ Distance (km)

Speed (km/h) = Distance (km) ÷ (Finish time (min) ÷ 60)

Variables:

  • t = finish time in minutes (e.g., 50)
  • d = distance in kilometers (e.g., 10)
  • Pace = minutes per kilometer, the time it takes to cover one kilometer
  • Speed = kilometers per hour, the average speed over the whole distance

Worked Example

Using the default values: you finish a 10 km run in 50 minutes.

First, calculate pace:

Pace = 50 min ÷ 10 km = 5.00 min/km

Then, calculate speed:

Speed = 10 km ÷ (50 min ÷ 60) = 10 ÷ 0.8333 = 12.00 km/h

So your average pace is 5 minutes per kilometer, and your average speed is 12 km/h. The calculator shows these results rounded to two decimals.

Why Encoding Mismatches Happen

Every text file, email, or web page carries a hidden label (or lacks one) that tells software which encoding was used. The most common encodings are:

  • UTF-8 – the dominant encoding on the web, supports all languages and emoji.
  • Windows-1252 – a legacy Windows encoding for Western European languages.
  • ISO-8859-1 – an older Latin-1 standard, often confused with Windows-1252.
  • UTF-16 – used by Windows and Java internally, but rarely for files.
  • Shift_JIS – a legacy Japanese encoding.

When a file saved as UTF-8 is opened as Windows-1252, the multi-byte sequences that represent accented letters or non-Latin characters become invalid bytes, and the software displays a replacement character (�) or a question mark. The reverse also happens: a file saved as Windows-1252 opened as UTF-8 may show garbled text or question marks for characters like curly quotes or em dashes.

How to Fix Question Marks in Files

If you are seeing question marks in a document or text file, try these steps:

  1. Open the file in a text editor that lets you choose encoding – Notepad++ (Windows), TextEdit (Mac), or VS Code. Look for an “Encoding” menu or a status bar indicator.
  2. Try opening the file with a different encoding – Common options: UTF-8, Windows-1252, ISO-8859-1, or UTF-16. The correct one usually makes the text readable immediately.
  3. If the file is corrupted – If no encoding makes sense, the file may have been saved incorrectly or cut off. Check if you have a backup or an earlier version.
  4. For web pages – In your browser, go to View → Encoding and try different options, or use the browser’s auto-detect feature.

Question Marks in Databases and Emails

Databases often store text in a specific character set (like Latin1 or UTF-8). If the connection between the database and your application uses a different character set, you may see question marks instead of accented letters. For example, a French name like “François” stored in UTF-8 but read as Latin1 can display as “François” or with question marks. The fix is to ensure the database, the connection, and the application all use the same character set (ideally UTF-8).

Emails show question marks when the sender and receiver use different encodings, or when the email client fails to detect the charset. Most modern email clients handle this automatically, but if you receive a garbled email, you can try changing the encoding in your email client’s view menu.

How to Prevent Encoding Issues

To avoid question marks in the future:

  • Always save new files as UTF-8 – Most editors default to this, but double-check if you share files with others.
  • Include a BOM (Byte Order Mark) for UTF-8 – Some older Windows programs need it to recognize UTF-8. This adds invisible characters at the start of the file.
  • Use a consistent character set in databases – Set the database, table, and connection to UTF-8.
  • Avoid copy-pasting from web pages into plain text files – This often introduces encoding mismatches.

Common Misconceptions

Misconception: Question marks mean the data is lost. Not always. If the text was encoded in UTF-8 and you see question marks, the underlying bytes are still there; you just need to open the file with the correct encoding. However, if the file was saved with a lossy conversion (e.g., from UTF-8 to ASCII), the characters are permanently gone.

Misconception: UTF-8 is the same as ASCII. ASCII is a 7-bit encoding with 128 characters. UTF-8 is backwards-compatible with ASCII for the first 128 characters, but it adds many more characters using multi-byte sequences. So a file with only basic English letters is identical in both, but accented letters differ.

Frequently Asked Questions

Why do I see question marks in my CSV file when I open it in Excel?

Excel often assumes files are in the system’s default encoding (Windows-1252 on English systems). If your CSV is UTF-8 without a BOM, Excel may misinterpret it. Open the file using Excel’s “From Text/CSV” import and choose UTF-8 encoding, or add a BOM to the file.

What does the � symbol mean?

The replacement character (U+FFFD) is shown when a program encounters a byte sequence that is invalid in the declared encoding. It is a placeholder meaning “I don’t know what this character is.” It is different from a regular question mark, which is a valid character.

Can I recover text that shows as question marks?

If the original file is still intact, yes. Open it in a text editor that allows you to switch encodings and try different ones until the text appears correctly. If the file was already converted to a lossy encoding (like ASCII), the characters are gone and cannot be recovered.

Why do my friend’s messages show question marks on my phone?

This usually happens when your phone’s messaging app uses a different character encoding than your friend’s. Most modern apps use UTF-8, but older devices or certain emoji can cause issues. Updating your messaging app or using a different one often fixes it.

Is there a way to detect the encoding of a file?

Yes, many text editors and command-line tools can auto-detect encoding. For example, the file command on Linux/macOS can often identify the encoding. In browsers, you can manually switch encodings to see which one makes the text readable.

Understanding character encoding is the key to solving the mystery of question marks. By knowing what encoding your files use and ensuring consistency, you can avoid most display issues.

Related

Formula used
in t | Finish time | min | 50 | 0
in d | Distance | km | 10 | 0 | 100000
out pace | Average pace | min/km | t / d | 2
out speed | Average speed | km/h | d / (t / 60) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →