Skip to main content

4. Charsets

The character mnemonics hav been used to table a number of coded character sets. The coded character set names are taken if possible from the official ISO registration description in the ISO 2375 (ECMA) register, or with a number like the code page number - or with an indication of the language or country it is being used for - using

the country designators of ISO 3166. For the character sets in the ECMA register, their ISO registration number is also given (as ISO- IR-xxx). Often the ISO registration number does not cover all the codes of a character set in use, but for instance only the graphical characters, where another ISO registration number covers the control characters; in the case of the 8-bit character sets the ISO registration only covers the upper graphical characters (GR). The ISO registration number is here taken to indicate the full coded character set including control characters and lower half of the graphical characters, normally ISO 6429 and ASCII, respectively.

The ISO definition of the term "coded character set" is as follows: "A set of unambiguous rules that establishes a character set and the one-to-one relationship between the characters of the set and their coded representation." and this definition may be subject to different interpretations. This memo does not put further restrictions on the term of "coded character set" than the following: "A coded character set is a set of rules that unambiguously and completely determines which sequence of characters, if any, is represented by each possible sequence of n-bit bytes for a certain value of n." This implies that e.g. a coded character set extended with one or more other coded character sets by means of the extension techniques of ISO 2022 constitutes a coded character set in its own right. In this memo the term "charset" is used to refer to the above interpretation of the ISO term "coded character set".

A special problem is, if two characters of two different coded character sets with the same descriptive name, or depicted by what looks like the same graphic symbol, or with the same historical origin, really are to be regarded as the same character or not. This problem has been studied in great detail in the development efforts that have resulted in ISO DIS 10646 and Unicode (under the heading "character unification"). As much as possible such results have been used in the construction of the code tables of this section.

4.1. Charset Naming​

The coded character set names are given in ISO 646 invariant subset (83 characters, where a space in the name is replaced with an underline character; sometimes a hyphen is also used instead of a blank, or the blank is eliminated when practice exist). Case is not significant in the charset names.

4.2. Code Table Format​

The following code tables are given in a simple format to facilitate use of this text as program input. Programs and routines written in C to handle these tables are freely available from the author of this memo. Keywords are signified with the character "&" as the first character, to distinguish them from ordinary data. Numbers may be given in decimal, hexadecimal or octal notation; hexadecimal numbers are given with an "x" as the first character, and octal numbers has an "o" as the first character.

The following keywords are used:

"&charset" has one parameter defining the name of the character set. This is required for every character set.

"&alias" has one parameter defining a possible alternate name for the character set. This is optional.

"&g0esc", "&g1esc", "&g2esc", "&g3esc", "&c0esc", "&c1esc" has one parameter indicating the string of octets used to define the character set as the G0, G1, G2, G3, C0 or C1 set respectively, according to ISO 2022 (11). The string is to be preceded by an ESC character. It is only the relevant parts of the table, which can be used with the definition; the charset is often coded with both graphical and control character sets. If the coded character set is a 96-character set, it is tabled with the relevant GL set (normally ISO-IR-6) and with ISO 6429 as C0 and C1 (12). If it is a 94- character set, it is tabled with the C0 set of ISO 6429. If it is a double-octet coded character set, it is tabled without control character sets and accompanying one-octet coded character sets, and the two-octet code is tabled as a G0 set.

"&bits" has one parameter indicating the number of bits to represent the charset. This is optional and 8 bits is the default.

"&code" has one parameter indicating the byte number allocated to the following character mnemonic. After the "&code" specification the characters are listed with their mnemonic in ascending order. A character mnemonic of "??" indicates that the position is unused. A character mnemonic of "__" indicates that the character set is not completely defined with the specifications in this memo.

"&code2" has 2 parameters specifying the row and column in certain 16-bit character sets. The value 32 must be added to obtain the first and second byte respectively. Mnemonics can be specified after the "&code2" specification as mentioned for the "&code" specification.

"&codex" has 5 parameters, specifying the character set prefix string, the start row number, the end row number, the start column number and the end column number respectively. This is equivalent to specifying a series of mnemonics of the form "nrrcc" where "n" is the character set name prefix string, "rr" is the row number running from the specified start row number to the end row number, and "cc" is the column number running from the specified start column number to the end column number. The thereby created series mnemonics are allocated to code positions which are added 32 to the row and column numbers to get the row and column octet.

"&duplicate" has a special meaning indicating that a position is being used for more than one character. This is an ugly convention but it is a sad fact of life that same code in one coded character set can mean different characters. "&duplicate" takes two parameters

  • the first is the code to be duplicated, the other is the new mnemonic.

"&rem" is followed by text to explain something in the table to a human reader. All lines in such a remark has to start with this keyword.

"&comb2" specifies a combination of two characters which signifies a third character. All characters in the specification are given by their mnemonic. The two combining characters must be specified previously in the code table. The first combining character is specified as the first character after the keyword, and then the following pairs of characters are the second combining character and the result, respectively. The specification can be repeated, terminated by an occurrence of a keyword.

4.3. Mnemonic charsets​

The following is compatible with current practice on the internet within EUnet - the European not-for-profit networking organisation in Europe and North Africa currently operating in 24 countries.

The mnemonic charsets are a family of charsets which have the facility that within the relevant parts of the message, encoded in an ordinary coded character set, text may have occurrences of the following sequence: an intro character sequence, followed by a string of characters that represent a character mnemonic, as described below. Similarly, the intro character sequence may be doubled, indicating a single occurrence of the respective symbols in decoded format.

Note that many characters within a mnemonic character set may be represented in two different ways. Normally the character itself is used, but it is also possible to use the mnemonic allocated to the character in a mnemonic sequence.

In this way all characters with assigned mnemonics can be represented without information loss in any character set, which contains the invariant ISO 646 characters as a subset. As a consequence, using a mnemonic character set all these characters can be generated uniformly on all keyboards and presented uniformly on all terminal equipment, whenever the real character is not available.

Data encoded in a mnemonic charset is intended to be read by the end user possibly without further treatment. If the transport encoding and the presentation encoding for the user differ, it is recommended that the data be translated into a mnemonic representation in the presentation encoding.

A mnemonic charset is specified with the name "mnemonic+charset+intro" where "mnemonic" is written as given and "charset" and "intro" is specified as described below. The mnemonic charset "mnemonic" is a shorthand for "mnemonic+ascii+38". The

mnemonic charset "mnem" is a shorthand for "mnemonic+ascii+8200".

It is discouraged to use mnemonics for Chinese characters of either Chinese, Japanese or Korean origin, as the probability that the end user equipment can deal with the original encoding is very high for the intended receiver, and the mnemonics for such Chinese characters described in this memo convey very little meaning to humans.

4.3.1. charset​

The charset is given as one of the charset names in this memo and is the encoding used for the transport. It cannot be a mnemonic charset.

4.3.2. Intro​

The intro character sequence is given as the decimal value of the intro characters in the transport character set. There may be up to two characters used in the intro character sequence, and the decimal value for two-character intro sequences are then the first character value multiplied with 256 to the power of the number of octets used in the character set, plus the second character value. The recommended value is 38 for the ampersand (&) character in ASCII. Another common value is 29 for the control character "Group Separator", or 8200 for "space" followed by "backspace", which may be convenient when operating in some environments, and ordinary text is not changed. Only the ampersand character may be chosen as intro from the invariant ISO 646 charset, but any character not in the invariant ISO 646 character can be used as intro. The intro character sequence is used for introducing character mnemonics when a character is not present in the mail transport character set (as defined by "charset"). Character mnemonics longer than two characters are surrounded by the underline character. The intro character sequence is doubled to represent one occurrence of itself. Characters in the mail transport character set are normally just represented with their encoding, but may also be represented by the intro character sequence and the mnemonic encoding.

If the intro character sequence is specified as 0 (zero), it is omitted in the transport, giving a better readably content, but eliminating the possibility of reversibility and introducing an information loss. With intro specified as 0, also underline characters surrounding mnemonics longer than 2 characters are removed. Mnemonic charsets with the intro specified as zero is equivalent to the ordinary charset, e.g. "mnemonic+ascii+0" is equivalent to "ascii".

The intro character can be given in a header "Mnemonic-Intro:" with the value given in decimal as noted above in the first parameter. This has only meaning if the charset can be deducted by other information as specified by the relevant Internet specification. This information has precedence over other information on the intro.

4.3.3. Compatibility​

If applications conforming to this memo interoperate with other versions of this memo, and encounter mnemonics that are undefined with this memo, they shall leave the mnemonic as it is coded. This provides for upward compatibility.

4.3.4. Conversion Between Mnemonic Charsets​

To determine which mnemonic charsets are permitted with the use of an Internet specification, please refer to that specification. It may be that only "ASCII" or "INVARIANT" is allowed as the base charset. ASCII is the most used character set, while INVARIANT will be very robust for traversing gateways, but it will cause trouble for (amongst other things) source code for several programming languages. The use of other character sets may be limited to agreement between the communicating parties. When such an agreement has been achieved, a conversion between different mnemonic charsets can be done according to the charset tables below, as characters occurring in both encodings are just transformed, and characters not existing in the receiving coded character set are represented by the intro character sequence of the receiving coded character set plus the character mnemonic, as described for the intro character sequence. The characters forming the mnemonic are translated into the receiving code, which must have these characters present. An undefined character in the originating coded character set is transformed into the following sequence: the intro character sequence, an underline, a question mark character, a "u" (for undefined) and then the hexadecimal value of the character with letters in lowercase (possibly more than one byte for multibyte character sets) and then a terminating underline character. Headers may need to be changed accordingly to reflect such conversion. The character mnemonic "/c" has a special meaning in specifying that a line is to be continued even if the next characters are specifying a new line.