Windows-1251 Windows-1251 (CP-1251, Cyrillic) Windows Code Pages
The dominant Cyrillic code page on Windows systems — more widely adopted historically than the formal ISO-8859-5 standard.
What it is
Windows-1251 is Microsoft's Cyrillic code page, and was — during the Windows-dominant desktop era — the most widely used Cyrillic encoding in practice, outpacing the formal ISO-8859-5 standard and competing with KOI8-R for Russian and other Cyrillic-script language text.
Byte structure
| Byte range | Content |
|---|---|
| 0x00–0x7F | Identical to ASCII |
| 0x80–0xFF | Cyrillic letters and symbols, laid out differently from both ISO-8859-5 and KOI8-R |
Why your text is garbled (symptom → cause)
| Symptom | Likely cause |
|---|---|
| Cyrillic text is unreadable garbage | Three-way encoding confusion — text is Windows-1251, ISO-8859-5, or KOI8-R, each with different byte layouts for the same Cyrillic letters |
| Old Russian-language Windows software text breaks when moved to modern systems | Legacy Windows-1251 data needing explicit conversion to UTF-8 |
Compatibility & gotchas
- The most commonly encountered of the three major legacy Cyrillic encodings (alongside ISO-8859-5 and KOI8-R) specifically due to Windows' historical desktop dominance in Russian-speaking and other Cyrillic-script regions.
- Byte layout is genuinely different from both ISO-8859-5 and KOI8-R — there's no shortcut for guessing which one applies; testing decode results against readable text is usually necessary for unlabeled legacy data.
Fixing it
- Command-line conversion:
iconv -f WINDOWS-1251 -t UTF-8 input.txt -o output.txt - If unsure which Cyrillic encoding applies: try all three candidates (Windows-1251, ISO-8859-5, KOI8-R) and check which produces coherent text.
Comparison
| Encoding | Key difference from Windows-1251 |
|---|---|
| ISO-8859-5 | The formal ISO standard, less commonly adopted in practice than Windows-1251 |
| KOI8-R | Historically dominant in Unix/early Russian internet contexts, different byte layout entirely |
| UTF-8 | Full Unicode coverage, the modern default |
FAQ
Why was Windows-1251 more common than ISO-8859-5?
Windows' dominance of desktop computing in Cyrillic-script-using regions during the relevant era meant its native code page saw far more real-world deployment than the formal ISO alternative, despite ISO-8859-5 being the internationally standardized option.
Fun fact
The existence of three genuinely different, mutually incompatible legacy Cyrillic encodings (Windows-1251, ISO-8859-5, KOI8-R) — each with meaningful historical adoption — made Cyrillic text one of the more encoding-confusion-prone scripts of the pre-Unicode era, a title it shares with the equally fragmented Japanese encoding landscape (Shift-JIS vs. EUC-JP).