Files
2025-10-25 03:02:53 +03:00

3.5 KiB
Raw Permalink Blame History

[text.encoding.general]

28 Text processing library [text]

28.4 Text encodings identification [text.encoding]

28.4.2 Class text_encoding [text.encoding.class]

28.4.2.2 General [text.encoding.general]

1

#

A registered character encoding is a character encoding scheme in the IANA Character Sets registry.

[Note 1:

The IANA Character Sets registry uses the term “character sets” to refer to character encodings.

— end note]

The primary name of a registered character encoding is the name of that encoding specified in the IANA Character Sets registry.

2

#

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

NATS-DANO (33)

NATS-DANO-ADD (34)

3

#

Each known registered character encoding is identified by an enumerator in text_encoding::id, and has a set of zero or more aliases.

4

#

The set of aliases of a known registered character encoding is animplementation-defined superset of the aliases specified in the IANA Character Sets registry.

The set of aliases for US-ASCII includes “ASCII”.

No two aliases or primary names of distinct registered character encodings are equivalent when compared by text_encoding::comp-name.

5

#

How a text_encoding object is determined to be representative of a character encoding scheme implemented in the translation or execution environment isimplementation-defined.

6

#

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:

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

e.mib() == text_encoding(e.name()).mib() is true.

7

#

Recommended practice:

  • (7.1)

    Implementations should not consider registered encodings to be interchangeable. [Example 1: Shift_JIS and Windows-31J denote different encodings. — end example]

  • (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. [Example 2: Big5 — end example]