[text.encoding.general]

# 28 Text processing library [[text]](./#text)

## 28.4 Text encodings identification [[text.encoding]](text.encoding#general)

### 28.4.2 Class text_encoding [[text.encoding.class]](text.encoding.class#text.encoding.general)

#### 28.4.2.2 General [text.encoding.general]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L5063)

A [*registered character encoding*](#def:encoding,registered_character "28.4.2.2 General [text.encoding.general]") is
a character encoding scheme in the IANA Character Sets registry[.](#1.sentence-1)

[*Note [1](#note-1)*:

The IANA Character Sets registry uses the term âcharacter setsâ
to refer to character encodings[.](#1.sentence-2)

â *end note*]

The primary name of a registered character encoding is
the name of that encoding specified in the IANA Character Sets registry[.](#1.sentence-3)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L5073)

The set of known registered character encodings contains
every registered character encoding
specified in the IANA Character Sets registry except for the following:

- [(2.1)](#2.1)

NATS-DANO (33)

- [(2.2)](#2.2)

NATS-DANO-ADD (34)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L5082)

Each known registered character encoding
is identified by an enumerator in text_encoding​::​id, and
has a set of zero or more [*aliases*](#def:encoding,registered_character,alias "28.4.2.2 General [text.encoding.general]")[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L5087)

The set of aliases of a known registered character encoding is animplementation-defined
superset of the aliases specified in the IANA Character Sets registry[.](#4.sentence-1)

The set of aliases for US-ASCII includes âASCIIâ[.](#4.sentence-2)

No two aliases or primary names of distinct registered character encodings
are equivalent when compared by text_encoding​::​*comp-name*[.](#4.sentence-3)

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L5095)

How a text_encoding object
is determined to be representative of a character encoding scheme
implemented in the translation or execution environment isimplementation-defined[.](#5.sentence-1)

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L5102)

An object e of type text_encoding such thate.mib() == text_encoding​::​id​::​unknown is false ande.mib() == text_encoding​::​id​::​other is false maintains the following invariants:

- [(6.1)](#6.1)

*e.name() == '\0' is false, and

- [(6.2)](#6.2)

e.mib() == text_encoding(e.name()).mib() is true[.](#6.sentence-1)

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L5112)

*Recommended practice*: 

- [(7.1)](#7.1)

  Implementations should not consider registered encodings to be interchangeable[.](#7.1.sentence-1)
  [*Example [1](#example-1)*:
  Shift_JIS and Windows-31J denote different encodings[.](#7.1.sentence-2)
 â *end example*]

- [(7.2)](#7.2)

  Implementations should not use the name of a registered encoding
to describe another similar yet different non-registered encoding
unless there is a precedent on that implementation[.](#7.2.sentence-1)
  [*Example [2](#example-2)*:
  Big5
 â *end example*]
