UnicodeDecodeError Python Origin: Application & API Last updated 15 Oct 2026

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 10: invalid start byte

Python read bytes that aren’t valid in the encoding it assumed (usually UTF-8).

Exact message you may see codec can't decode byteinvalid start byteinvalid continuation byte
Seen on: Python

Meaning

The file was saved in another encoding (Windows-1252/latin-1, UTF-16), or it’s binary. Byte 0x92 is a Windows “smart quote”; 0xff 0xfe at the start indicates UTF-16.

Common causes

  • CSV exported from Excel in cp1252
  • Reading a binary file in text mode
  • UTF-16 file
  • Default encoding differs on Windows

⚡ Quick fix

  1. Pass the right encoding: open(p, encoding="cp1252")
  2. Try encoding="utf-8-sig" for BOM files
  3. Use errors="replace" only when data loss is acceptable
  4. Open binaries with "rb"

Detailed fix by platform

Python

  1. pd.read_csv("export.csv", encoding="cp1252")

How to diagnose

  1. Byte — Which byte value? (0x92/0x96 → cp1252, 0xff 0xfe → UTF-16)
  2. File — Text or binary?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

0x80070020 — 0x80070020: The process cannot access the file because it is being used by another process (Windows)0x800700200x80070570 — Error 0x80070570: The file or directory is corrupted and unreadable (Windows)0x8007057022021 — ERROR: invalid byte sequence for encoding "UTF8": 0x00 (PostgreSQL)22021Access to the path is denied — System.UnauthorizedAccessException: Access to the path 'x' is denied (.NET)Access to the path is…AccessDeniedException — java.nio.file.AccessDeniedException: /path (Java)AccessDeniedExceptionArgument list too long — bash: /bin/rm: Argument list too long (Linux)Argument list too longFileNotFoundError — FileNotFoundError: [Errno 2] No such file or directory: 'data.csv' (Python)FileNotFoundErrorFileNotFoundException — java.io.FileNotFoundException: config.properties (No such file or directory) (Java)FileNotFoundExceptionUnicodeDe…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.