UTF-8 encodes each Unicode character as a variable number of 1 to 4 octets, where the number of octets depends on the integer value assigned to the Unicode character. It is an efficient encoding of Unicode documents that use mostly US-ASCII characters because it represents each character in the range U+0000 through U+007F as a single octet.
UTF-8 is the default encoding for XML and since 2010 has become the dominant character set on the Web.
- RFC 3629: UTF-8, a transformation format of ISO 10646. November 2003.
- The Unicode Standard 5.0, November 2006. [purchase from Amazon.com]
Articles and background reading
- UTF-8 and Unicode FAQ for Unix/Linux by Markus Kuhn
- Forms of Unicode, an excellent overview by Mark Davis
- Wikipedia UTF-8 contains a good discussion of why five- and six-octet sequences are now illegal UTF-8
- Unicode Transformation Formats [czyborra.com]
- The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!), an amusing and informative article by Joel Spolsky
The MIME character set attribute for UTF-8 is
Character sets are case-insensitive, so
utf-8 is equally
valid. [IANA Character
In a modern HTML 5 page, place this tag inside
In an XML prolog, the encoding is typically specified as an attribute:
<?xml version="1.0" encoding="UTF-8" ?>