ISO-8859-5 (Cyrillic)

ISO standard for Cyrillic script. Covers Russian, Bulgarian, Serbian, Macedonian, and other languages. Largely replaced by KOI8-R in Russia and by UTF-8 globally.

ISO-8859-5
Fixed (1 byte)
1988

Byte Structure

ISO-8859-5 (Cyrillic) uses fixed 1-byte encoding per character. Characters not in this encoding cannot be represented and must be replaced or transliterated.

When to Use ISO-8859-5 (Cyrillic)

ISO-8859-5 (Cyrillic) is encountered in legacy Russian and Cyrillic-script content — older email, Usenet archives, and pre-Unicode Unix systems. UTF-8 is the correct choice for all new systems, but you'll need this encoding when reading or writing to legacy sources.

Sample Characters in ISO-8859-5 (Cyrillic)

The table below shows how a selection of characters are represented in ISO-8859-5 (Cyrillic). Bytes are shown in hexadecimal. Characters marked "not supported" cannot be encoded in ISO-8859-5 (Cyrillic) and would need to be replaced or transliterated when converting from Unicode.

Character Codepoint Name Bytes (Hex) Bytes (Decimal) Supported
A U+0041 LATIN CAPITAL LETTER A 41 65 Yes
a U+0061 LATIN SMALL LETTER A 61 97 Yes
0 U+0030 DIGIT ZERO 30 48 Yes
$ U+0024 DOLLAR SIGN 24 36 Yes
£ U+00A3 POUND SIGN not supported
© U+00A9 COPYRIGHT SIGN not supported
U+20AC EURO SIGN not supported
α U+03B1 GREEK SMALL LETTER ALPHA not supported
А U+0410 CYRILLIC CAPITAL LETTER A B0 176 Yes
U+4E2D not supported
U+3042 HIRAGANA LETTER A not supported
U+263A WHITE SMILING FACE not supported

Working with ISO-8859-5 (Cyrillic) in Code

Every major language has built-in support for encoding conversion. The examples below show how to encode a string to ISO-8859-5 (Cyrillic) bytes and decode it back to a Unicode string. Always specify the encoding explicitly — never rely on system defaults, which vary by OS and locale.

# Encode a string to iso-8859-5 bytes
text = "Hello, 世界"
encoded = text.encode("ISO-8859-5")

# Decode bytes back to a string
decoded = encoded.decode("ISO-8859-5")
// Convert to iso-8859-5
$bytes = mb_convert_encoding(
    "Hello, 世界",
    "ISO-8859-5",
    "UTF-8"
);

// Convert back to UTF-8
$text = mb_convert_encoding(
    $bytes,
    "UTF-8",
    "ISO-8859-5"
);
// Encode to ISO-8859-5 bytes
const encoder = new TextEncoder(); // UTF-8
const bytes = encoder.encode("Hello, 世界");

// Decode bytes
const decoder = new TextDecoder("ISO-8859-5");
const text = decoder.decode(bytes);
-- Create a database with ISO-8859-5 (Cyrillic)
CREATE DATABASE mydb
  ENCODING 'ISO-8859-5'
  LC_COLLATE 'en_US.UTF-8';

-- Check database encoding
SELECT pg_encoding_to_char(encoding)
FROM pg_database
WHERE datname = current_database();

Compare with Other Encodings

See how ISO-8859-5 (Cyrillic) differs from other encodings — which characters each supports and how the byte representations compare.