[text.encoding.overview]

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

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

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

#### 28.4.2.1 Overview [text.encoding.overview]

[1](#1)

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

The class text_encoding describes an interface
for accessing the IANA Character Sets registry[[bib]](bibliography#bib:iana-charset "Bibliography")[.](#1.sentence-1)

[ð](#lib:text_encoding)

namespace std {struct text_encoding {static constexpr size_t max_name_length = 63; // [[text.encoding.id]](text.encoding.id "28.4.2.6 Enumeration text_­encoding​::​id"), enumeration text_encoding​::​idenum class id : int_least32_t {*see below*}; using enum id; constexpr text_encoding() = default; constexpr explicit text_encoding(string_view enc) noexcept; constexpr text_encoding(id i) noexcept; constexpr id mib() const noexcept; constexpr const char* name() const noexcept; // [[text.encoding.aliases]](text.encoding.aliases "28.4.2.5 Class text_­encoding​::​aliases_­view"), class text_encoding​::​aliases_viewstruct aliases_view; constexpr aliases_view aliases() const noexcept; friend constexpr bool operator==(const text_encoding& a, const text_encoding& b) noexcept; friend constexpr bool operator==(const text_encoding& encoding, id i) noexcept; static consteval text_encoding literal() noexcept; static text_encoding environment(); template<id i> static bool environment_is(); private: id *mib_* = id::unknown; // *exposition only*char *name_*[max_name_length + 1] = {0}; // *exposition only*static constexpr bool *comp-name*(string_view a, string_view b); // *exposition only*};}

[2](#2)

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

Class text_encoding is
a trivially copyable type ([[basic.types.general]](basic.types.general#term.trivially.copyable.type "6.9.1 General"))[.](#2.sentence-1)
