Windows-1252 is the encoding behind countless mojibake bugs. This tool dumps the exact CP1252 byte for every character so you can see precisely how text like smart quotes and the euro sign is stored — and why it breaks when misread.
How it works
Windows-1252 is a single-byte encoding. For most of its range it matches ISO-8859-1 exactly, so the mapping is trivial:
0x00–0x7F : same as ASCII
0xA0–0xFF : same as ISO-8859-1
0x80–0x9F : CP1252-specific printable characters
The crucial part is that 0x80–0x9F range. Where Latin-1 reserves those bytes
for control codes, CP1252 reuses them for €, –, —, ”, ”, ™ and other
common symbols. The tool maps each character through this table; characters with
no CP1252 byte are shown with a dash.
The 0x80–0x9F range in full
This is the region that causes almost all CP1252 vs Latin-1 confusion. Here is the complete mapping for those 32 bytes:
| Hex | Character | Name |
|---|---|---|
| 0x80 | € | Euro sign |
| 0x82 | ‚ | Single low-9 quotation mark |
| 0x83 | ƒ | Latin small letter f with hook |
| 0x84 | „ | Double low-9 quotation mark |
| 0x85 | … | Horizontal ellipsis |
| 0x86 | † | Dagger |
| 0x87 | ‡ | Double dagger |
| 0x88 | ˆ | Modifier letter circumflex |
| 0x89 | ‰ | Per mille sign |
| 0x8A | Š | Latin capital letter S with caron |
| 0x8B | ‹ | Single left angle quotation mark |
| 0x8C | Œ | Latin capital ligature OE |
| 0x8E | Ž | Latin capital letter Z with caron |
| 0x91 | ‘ | Left single quotation mark |
| 0x92 | ‘ | Right single quotation mark |
| 0x93 | “ | Left double quotation mark |
| 0x94 | “ | Right double quotation mark |
| 0x95 | • | Bullet |
| 0x96 | – | En dash |
| 0x97 | — | Em dash |
| 0x98 | ˜ | Small tilde |
| 0x99 | ™ | Trade mark sign |
| 0x9A | š | Latin small letter s with caron |
| 0x9B | › | Single right angle quotation mark |
| 0x9C | œ | Latin small ligature oe |
| 0x9E | ž | Latin small letter z with caron |
| 0x9F | Ÿ | Latin capital letter Y with diaeresis |
Bytes 0x81, 0x8D, 0x8F, 0x90, and 0x9D are undefined in CP1252 (they produce a replacement character or error when decoded). In ISO-8859-1, all 32 bytes in this range are control codes with no printable glyph.
Common mojibake scenarios
Word processor to web: Microsoft Word and older Windows applications output CP1252 by default. When pasted into a system that expects UTF-8, the smart quotes and dashes in the 0x80–0x9F range produce garbled characters. For example, the curly opening double quote ” (0x93 in CP1252) becomes “ in UTF-8 if the bytes are misinterpreted.
Database migrations: Databases that were set up as Latin-1 or CP1252 frequently cause problems when migrated to UTF-8. If you see garbled accented characters or replaced symbols after migration, the source data was likely CP1252 and was decoded as ISO-8859-1 (which maps those bytes differently) or as raw UTF-8 (which cannot parse them at all).
CSV and text file imports: Spreadsheet exports from Windows frequently use CP1252. If you open a CP1252 CSV in a tool expecting UTF-8, names with accented characters, currency symbols, or typographic dashes will appear corrupted. The fix is to declare the encoding explicitly when reading the file.
ANSI in Windows APIs: Many Win32 APIs that accept “ANSI” strings use the active code page, which defaults to CP1252 on Western Windows. When this string is passed to a UTF-8 or Unicode-aware context without re-encoding, mojibake follows.
How to fix CP1252 mojibake
Once you have identified that data was incorrectly decoded, the fix is to re-encode: read the bytes as CP1252 and write them as UTF-8. In Python, for example: bytes_object.decode(‘windows-1252’).encode(‘utf-8’). The hex dump this tool produces lets you verify the original bytes so you can confirm the source encoding before applying a fix.
Tips and notes
- The euro sign
€is byte0x80in CP1252 but does not exist in Latin-1 — a classic source of broken imports. - Curly quotes (
” “ ‘ ‘) and the em dash (—) live in the special range, so text from Microsoft Word often needs CP1252-aware handling. - A dash in the dump tells you the character is outside CP1252 entirely and would need UTF-8 to represent.
- Use this tool to confirm the encoding of suspicious text before deciding on a fix — knowing the exact bytes is the first step in resolving any encoding bug.