Skip to content

Codepages and text encodings

Regardless of the source, JavaScript converts all the text it handles into UTF-16.

UTF-16 is based on Unicode and is compatible with UTF-8 and backward compatible with ISO-8859-1 and US-ASCII. But otherwise, all other loaded text must be transcoded to accurately display the characters.

Character set Support About
US-ASCII1 Inbuilt The original text encoding of the Internet
CP-437 Yes The most common encoding for ASCII, ANSI art, and text for PC and MS-DOS
CP-12522 Yes The default English encoding for legacy Windows3 is backward compatible with ISO-8859-1
ISO-8859-1 Inbuilt The replacement for US-ASCII that supported two times the characters and was the default encoding for the Commodore Amiga and legacy Linux
ISO-8859-15 Yes An update for ISO-8859-1 that added some missing characters such as the Euro sign
SHIFT JIS Inbuilt A legacy Japanese encoding used by Shift JIS art
UTF-8 Inbuilt The current standard encoding for modern HTML and most documents it supports over a hundred thousand characters
UTF-16 Inbuilt The Unicode implementation used by JavaScript and common for documents not written in the Latin alphabet
Yes Encodings that are mistakenly used by Chromium when viewing ANSI and ASCII art

Inbuilt support means the browser handles the character set.

  1. Historically known as ANSI X3.4 or ISO 646. 

  2. Also called Windows-1252 or Windows ANSI. 

  3. Created in 1985 for Microsoft Windows 1.0, it was revised in multiple releases of Windows, including Windows 95 and 98.