L
LLLOS.ai
Learn
L

Ask Your Tutor · Computer Science

What happens if I open a file with the wrong encoding?

From NCERT Asked by Anonymous from Frankfurt, Germany 24 Oct 2026, 8:08 AM IST Updated

In one line

If you open a file with the wrong encoding, the text may look strange, broken, or unreadable.

The rule

File encoding is the way a computer turns letters and symbols into numbers so they can be saved and read again. If you use the wrong encoding to open a file, the computer may not understand the numbers, and the text can appear as gibberish or question marks.

Let's understand it simply

Imagine you write a secret message using Hindi letters, but your friend tries to read it using only the English alphabet. The words will not make sense to them. In the same way, a computer uses encoding (a special code) to turn letters into numbers. If you open a file with the wrong code, the computer cannot turn the numbers back into the right letters.

Correct vs Wrong Encoding
Correct EncodingWrong Encoding
What you seeनमस्तेਨमसेतो

How it works

  1. When you save a file, the computer uses an encoding (like UTF-8, ASCII, or others) to store each letter as a number.
  2. When you open the file, the computer needs to know which encoding to use to turn the numbers back into letters.
  3. If you use the same encoding, the text looks correct.
  4. If you use the wrong encoding, the numbers are turned into the wrong letters or symbols.
  5. You might see boxes, question marks, or strange symbols instead of the real text.
What happens when you open a file with the wrong encoding
  1. File is saved with one encoding (e.g., UTF-8)
  2. You open it with a different encoding (e.g., ASCII)
  3. Computer reads the numbers using the wrong code
  4. Text appears as strange symbols or question marks

The story behind it

Encodings were made because computers only understand numbers. Early computers used simple codes like ASCII, which worked for English. But as people wanted to use other languages (like Hindi, Tamil, or Chinese), new encodings were created. Now, UTF-8 is very common because it supports almost all languages. But sometimes, old files or files from other countries use different encodings, which can cause problems.

Where you see it in real life

  • Opening a Hindi text file in Notepad, but seeing only boxes or question marks → Notepad used the wrong encoding.
  • Reading a CSV file from the internet, and some names have weird symbols → The file was saved in a different encoding.
  • Sending an email in Tamil, but the receiver sees broken letters → Their email app used the wrong encoding.
  • Downloading a book in another language, but it looks like random letters → The reading app did not use the correct encoding.

Why it matters

  • You cannot read or edit the file properly if the encoding is wrong.
  • Important data (like names, addresses, or marks) can be lost or changed.
  • In jobs like data entry or programming, using the right encoding saves time and avoids mistakes.
  • Exams and projects may require you to handle files in different languages or formats.

Common mistakes

  • Thinking all text files use the same encoding. (They do not — always check!)
  • Ignoring warnings about encoding when opening a file. (These warnings help you choose the right one.)
  • Trying to fix broken text by just changing the font. (It is the encoding, not the font, that is the problem.)

Remember it

If text looks strange, try opening the file with a different encoding — it is like using the right language to read a message.

Check yourself

What is encoding in a computer file?

It is the way computers turn letters and symbols into numbers to save and read text.

Why does text look broken if you use the wrong encoding?

Because the computer turns the numbers into the wrong letters or symbols.

How can you fix a file that looks like gibberish?

Try opening it with a different encoding, like UTF-8 or the one used to save it.

Quick recap

  • Encoding is how computers turn letters into numbers.
  • Wrong encoding makes text look strange or unreadable.
  • Always use the correct encoding to open a file.
  • Different languages and programs may use different encodings.
Written by the LLOS.ai tutor, checked against NCERT chapters. Asked by Anonymous from Frankfurt, Germany on 24 Oct 2026, 8:08 AM IST