UTF8(7)

NAME
utf8 - UTF-8 text encoding

DESCRIPTION
UTF-8 is a multibyte character encoding for Unicode text. It is the preferred format for non ASCII text.

Unicode codepoints are encoded as follows:

U+0000 – U+007F:
    One byte: 0....... (compatible with ASCII)

U+0080 – U+07FF:
    Two bytes: 110..... 10......

U+0800 – U+D7FF and U+E000 – U+FFFF:
    Three bytes: 1110.... 10...... 10......

U+10000 – U+10FFFF:
    Four bytes: 11110... 10...... 10...... 10......

The bits shown as dots contain the codepoint represented as a binary integer.

Bytes starting with the bit pattern 11...... are called UTF-8 start bytes, and those starting with 10...... UTF-8 continuation bytes. The number of leading 1 bits in a start byte indicates the total number of bytes used to encode the codepoint, including the start byte.

Encodings using more bytes than required are invalid. In particular, 11000000 and 11000001 are not valid start bytes, the byte after 11100000 must be at least 10100000, and the byte after 11110000 must be at least 10010000.

SEE ALSO
locale(1), ascii(7)

STANDARDS
F. Yergeau, November 2003, RFC 3629, UTF-8, a transformation format of ISO 10646.

The Unicode Standard: http://www.unicode.org/versions/latest/

The Unicode Character Database: http://www.unicode.org/reports/tr44/