Windows-1258 Windows-1258 (CP-1258, Vietnamese) Windows Code Pages
The Windows-native Vietnamese code page — notable for using combining diacritical marks rather than precomposed accented characters, unlike most other single-byte encodings.
What it is
Windows-1258 is Microsoft's Vietnamese code page, and it takes a structurally different approach from most other single-byte encodings in this list. Vietnamese uses an unusually large number of distinct accented letter forms (base Latin letters combined with tone marks and vowel modifiers) — more than a single byte's spare capacity could reasonably assign as individual precomposed characters. Windows-1258 addresses this by using combining diacritical marks: a base letter byte followed by a separate combining-mark byte, rather than one dedicated byte per accented letter as most other single-byte encodings do.
Byte structure
| Byte range | Content |
|---|---|
| 0x00–0x7F | Identical to ASCII |
| 0x80–0xFF | Vietnamese-specific base characters, symbols, and — notably — combining diacritical marks that modify the preceding base character rather than standing alone |
This combining-character approach is closer conceptually to how Unicode itself handles many accented characters (via combining diacritical marks as separate code points) than to the precomposed-character approach most other ISO-8859/Windows-125x encodings use.
Why your text is garbled (symptom → cause)
| Symptom | Likely cause |
|---|---|
| Vietnamese text shows base letters with tone marks in the wrong position or missing entirely | Software not correctly handling the combining-character model — treating each byte as an independent character rather than recognizing that some bytes modify the preceding one |
| Vietnamese text looks correct in one application, broken in another | Inconsistent combining-character support between applications — some older software wasn't designed with Windows-1258's combining-mark approach in mind |
Compatibility & gotchas
- Structurally different from other single-byte encodings on this list — the combining-character model means simple byte-by-byte processing logic that works fine for Latin-1-style precomposed encodings can mishandle Windows-1258 specifically.
- Closer to Unicode's own combining-character philosophy than most legacy single-byte encodings, which is a somewhat unusual design choice for a pre-Unicode-era encoding.
- Vietnamese also has other legacy encodings (VISCII, TCVN3) that predate and compete with Windows-1258 — if debugging Vietnamese text issues, it's worth confirming which specific legacy encoding is actually in play, since they're not interchangeable.
Fixing it
- Command-line conversion:
iconv -f WINDOWS-1258 -t UTF-8 input.txt -o output.txt - If Vietnamese text still displays incorrectly after conversion: verify the source wasn't actually VISCII or TCVN3 (other Vietnamese-specific legacy encodings), which require different
iconvsource parameters.
Comparison
| Encoding | Key difference from Windows-1258 |
|---|---|
| VISCII | An alternative Vietnamese-specific legacy encoding, not interchangeable with Windows-1258 |
| UTF-8 | Full Unicode coverage, uses combining characters similarly for some purposes, and is the modern default |
FAQ
Why does Windows-1258 use combining characters instead of one byte per accented letter?
Vietnamese has more distinct accented letter forms (base letters combined with tone marks and vowel modifiers) than a single byte's spare capacity could reasonably assign individually — combining characters let Windows-1258 cover the full range of Vietnamese text within the single-byte constraint.
Is Windows-1258 the only legacy Vietnamese encoding?
No — VISCII and TCVN3 are other pre-Unicode Vietnamese-specific encodings that saw real-world use and aren't interchangeable with Windows-1258. Confirming which one applies matters when working with older Vietnamese-language data.
Fun fact
Windows-1258's combining-character approach makes it a rare example of a single-byte legacy encoding that anticipated, in miniature, the same "base character plus combining modifier" philosophy Unicode later adopted at much larger scale — most other single-byte encodings instead relied entirely on precomposed characters, one byte per visually distinct letter form.