windows-1252 · shipping · also CP1252, Windows code page 1252

Windows-1252

Windows-1252 is a legacy single-byte encoding for Western European text with punctuation and symbols at byte positions outside the Latin-1 graphic repertoire.

Mapping: Byte 80 hexadecimal represents U+20AC, the euro sign, while 91 and 92 represent U+2018 and U+2019 quotation marks. The historical mapping leaves 81, 8D, 8F, 90 and 9D undefined. CPython's strict cp1252 decoder rejects these five values. The label ANSI alone does not specify this code page. [2] [3]

Web decoding: WHATWG uses a completed windows-1252 index that maps those five positions to their corresponding control code points. Its TextDecoder therefore accepts them even with fatal: true. It also resolves latin1 and iso-8859-1 labels to this encoding; that is a web API rule, not a statement that the registered character sets are identical. [5] [4] [1]

Recovery: Choose a concrete decoding contract before interpreting stored names or metadata. Byte 80 can produce a euro sign through TextDecoder("latin1") and a control through Buffer.toString("latin1") in the same Node runtime. A replacement policy can also collapse distinct rejected byte sequences. Preserve original bytes and test destination-name equality separately. [6] [7]

Relations

related
ISO-8859-1 (Latin-1), Character encoding, ASCII, UTF-8, Filename collision

Limitations

  • A successful decode does not identify the original encoding or establish destination filename validity.

Citations

  1. IANA character sets: distinct ISO-8859-1 and windows-1252 registrations (accessed 2026-11-20)
  2. Microsoft CP1252 to Unicode mapping, table 2.01, 1998-04-15 (accessed 2026-11-20)
  3. CPython 3.12.3: strict cp1252 decoder and undefined entries (accessed 2026-11-20)
  4. WHATWG Encoding Standard: names and labels (accessed 2026-11-20)
  5. WHATWG windows-1252 index, dated 2024-09-18 (accessed 2026-11-20)
  6. Node.js 24: Buffer character encodings and WHATWG compatibility warning (accessed 2026-11-20)
  7. Hesela: Latin-1 and Windows-1252 decoder contracts in filename recovery (accessed 2026-11-20)
Sources & caveats
  • Historical mapping and WHATWG index are distinct contracts. Exhaustive constructed byte observations and runtime versions: https://hesela.dev/research/legacy-single-byte/README.md. No measured incident frequency.

JSON: /data/terms/windows-1252.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Windows-1252. Hesela. 2026-11-20. https://hesela.dev/terms/windows-1252/