{
  "slug": "windows-1252",
  "term": "Windows-1252",
  "aliases": [
    "CP1252",
    "Windows code page 1252"
  ],
  "definition": "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.",
  "note": "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. [cp1252-map] [python-cp1252]\n\nWeb 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. [whatwg-index] [whatwg-labels] [iana]\n\nRecovery: 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. [node-buffer] [hesela-filenames]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    "A successful decode does not identify the original encoding or establish destination filename validity."
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-20",
  "related": [
    "iso-8859-1",
    "character-encoding",
    "ascii",
    "utf-8",
    "filename-collision"
  ],
  "citations": [
    {
      "id": "iana",
      "title": "IANA character sets: distinct ISO-8859-1 and windows-1252 registrations",
      "url": "https://www.iana.org/assignments/character-sets",
      "accessed": "2026-11-20"
    },
    {
      "id": "cp1252-map",
      "title": "Microsoft CP1252 to Unicode mapping, table 2.01, 1998-04-15",
      "url": "https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT",
      "accessed": "2026-11-20"
    },
    {
      "id": "python-cp1252",
      "title": "CPython 3.12.3: strict cp1252 decoder and undefined entries",
      "url": "https://github.com/python/cpython/blob/v3.12.3/Lib/encodings/cp1252.py",
      "accessed": "2026-11-20"
    },
    {
      "id": "whatwg-labels",
      "title": "WHATWG Encoding Standard: names and labels",
      "url": "https://encoding.spec.whatwg.org/#names-and-labels",
      "accessed": "2026-11-20"
    },
    {
      "id": "whatwg-index",
      "title": "WHATWG windows-1252 index, dated 2024-09-18",
      "url": "https://encoding.spec.whatwg.org/index-windows-1252.txt",
      "accessed": "2026-11-20"
    },
    {
      "id": "node-buffer",
      "title": "Node.js 24: Buffer character encodings and WHATWG compatibility warning",
      "url": "https://nodejs.org/docs/latest-v24.x/api/buffer.html#buffers-and-character-encodings",
      "accessed": "2026-11-20"
    },
    {
      "id": "hesela-filenames",
      "title": "Hesela: Latin-1 and Windows-1252 decoder contracts in filename recovery",
      "url": "https://hesela.com/analyses/filename-identity-backup-restores/#legacy-single-byte",
      "accessed": "2026-11-20"
    }
  ],
  "provenance": [
    "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."
  ]
}
