Network Working GroupT. Bray
Internet-DraftAntarctica Systems, Inc.
Expires: April 17, 2004J. Cowan
 Reuters Health
 October 18, 2003

The UTF-8+names Unicode Encoding Form


Status of this Memo

This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

The list of current Internet-Drafts can be accessed at

The list of Internet-Draft Shadow Directories can be accessed at

This Internet-Draft will expire on April 17, 2004.

Copyright Notice

Copyright (C) The Internet Society (2003). All Rights Reserved.


This memo presents a variation of the UTF-8 Unicode Encoding which allows a list of well-known characters to be encoded using concise names delimited by the characters "&" and ";".

Table of Contents

1.  Introduction and Motivation
2.  Note on Nomenclature
3.  UTF-8 and UTF-8+names
4.  Undefined Replacements
5.  The "&" Replacement
6.  The HTML Replacement Set
7.  The MathML Representation Set
§  References
§  Authors' Addresses
A.  Acknowledgements
§  Intellectual Property and Copyright Statements


1. Introduction and Motivation

This memo describes a variation of the UTF-8 Unicode[5] encoding format which allows a list of well-known characters to be encoded using concise names delimited by the characters "&" and ";".

This type of syntax is commonly used in XML[1] for characters that are "difficult", that is to say not easily entered using available input technology, or not displayable with available display technology, or both. An example would be an Anglophone author using a QWERTY keyboard wanting to enter the character "lower-case n with tilde", U+00F1 in Unicode. In XML, this may be referred directly by reference to its Unicode code-point: "ñ" - this is called a "numeric character reference" (NCR). XML also provides includes a facility called the "Document Type Definition" (DTD) which allows declaring a name for an arbitrary string such as the NCR above. For example, the DTD could declare the name "ntilde", then the author could enter this character as "ñ" which is considerably more readable and memorable than the NCR form. In XML, this technique is called an "internal parsed entity".

All these techniques in XML were inherited directly from SGML[2].

Several large collections of entity declarations assigning short names to well-known Unicode characters have been published in the course of the development of popular SGML and XML dialects including HTML, and are widely used in practice.

For a variety of reasons, authors increasingly wish to avoid the use of DTDs, but still want to retain the convenience and readability of internal parsed entities. It seems unlikely that the desired functionality will be provided by any XML-specific technology now under development.

The UTF-8+names Unicode Encoding Format is designed specifically to meet these requirements from the XML community. However, it has no dependence whatsoever on any aspect of XML and may be freely used in other textual contexts.


2. Note on Nomenclature

The UTF-8 Unicode Encoding Form encodes 7-bit ASCII characters as themselves; that is to say, the character "X" (U+0058) is encoded in a single octet whose value is (in C syntax) 0x58. For convenience, in the following discussion, when we say "The ASCII character 'X'", we mean "The single-octet UTF-8 encoding of the Unicode character 'X', that is to say the octet 0x58."


3. UTF-8 and UTF-8+names

The definition of UTF-8+names includes by reference the definition of UTF-8 as provided in Section 3.9 of the Unicode Specification. UTF-8+names adds one rule: Sequences of octets beginning with ASCII "&" and ending with ASCII ";" encode Unicode character sequences as specified in this document. The occurrence in a text of an octet containing an ASCII "&" not followed by an ASCII ";" before the end of the text is an encoding error.

In UTF-8+names, the sequence consisting of an "&", a character string, and a ";" is called a "replacement". The characters contained between the "&" and the ";" are called the "replacement name" and the Unicode character sequence which is represented is called the "replacement value."

Replacement names are case-sensitive, that is to say the replacements "Δ" and "δ" are distinct.

Not all conforming UTF-8 texts are conforming UTF-8+names texts. For example, the text "Pat & Mike" is UTF-8 but is not UTF-8+names, because it contains an "&" with no matching ";".

All UTF-8+names texts are conforming UTF-8 texts, but they may represent very different Unicode character seqences. Thus, it is important that users of the UTF-8+names encoding always be clear that the encoding is in use.


4. Undefined Replacements

For replacements whose names are not given a replacement value by this specification, the replacement value is identical to the replacement name. For example, the replacement "&U2;" represents the Unicode character sequence of length 4 containing the characters U+0026 AMPERSAND, U+0055 LATIN CAPITAL LETTER U, U+0032 DIGIT TWO, and U+003B SEMICOLON.


5. The "&" Replacement

The replacement "&&;" (i.e. whose name is "&") represents the single Unicode character U+0026 AMPERSAND.


6. The HTML Replacement Set

This document adopts by reference HTML's parsed internal entities, specifically those defined in Appendix A.2 of the XHTML 1.0 specification[4], as replacements. All of the internal parsed entities described there are defined to be UTF-8+names replacements. To see how this works, consider the first entity defined there:

<!ENTITY nbsp   "&#160;"> <!-- no-break space = non-breaking space,
                                  U+00A0 ISOnum --> 

In UTF-8+names terms, there is a replacement whose name is "nbsp" and whose value is the Unicode character sequence of length 1 containing the character U+00A0 NO-BREAK SPACE.


7. The MathML Representation Set

This document adopts by reference MathML's parsed internal entities which correspond to Unicode character sequences as replacements. Pointers to the definitions are collected in Section 6 of the Mathml 2.0 specification[3]. Note that these largely correspond to sets of SGML entities previously defined by ISO.

For example, MathML defines an entity "int" for the integral sign, U+222B. Thus, in UTF-8+names there is a replacement whose name is "int" and whose value is the Unicode character sequence of length 1 containing the character U+222B INTEGRAL.



[1] World Wide Web Consortium, "Extensible Markup Language (XML) 1.0", W3C XML, February 1998.
[2] International Standords Organizotion, "Standard Generalized Markup Language (ISO 8879)", October 1986.
[3] World Wide Web Consortium, "Mathematical Markup Language (MathML) Version 2.0", February 2001.
[4] World Wide Web Consortium, "XHTML 1.0 The Extensible HyperText Markup Language (Second Edition)", January 2000.
[5] The Unicode Consortium, "The Unicode Consortium: The Unicode Standard, 4.0.0", January 2003.


Authors' Addresses

  Tim Bray
  Antarctica Systems, Inc.
  John Cowan
  Reuters Health


Appendix A. Acknowledgements

This idea was provoked by an email interchange on the "xml-plenary" mailing list of the World Wide Web Consortium between Rick Jelliffe and Martin Duerst, in a discussion launched by Michael Sperberg-McQueen. Arnaud Lehors and Lauren Wood made significant contributions.


Intellectual Property Statement

Full Copyright Statement