Files
cppdraft_translate/cppdraft/text/encoding/overview.md
2025-10-25 03:02:53 +03:00

2.1 KiB
Raw Blame History

[text.encoding.overview]

28 Text processing library [text]

28.4 Text encodings identification [text.encoding]

28.4.2 Class text_encoding [text.encoding.class]

28.4.2.1 Overview [text.encoding.overview]

1

#

The class text_encoding describes an interface for accessing the IANA Character Sets registry[bib].

🔗

namespace std {struct text_encoding {static constexpr size_t max_name_length = 63; // [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], 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 static bool environment_is(); private: id mib_ = id::unknown; // exposition onlychar name_[max_name_length + 1] = {0}; // exposition onlystatic constexpr bool comp-name(string_view a, string_view b); // exposition only};}

2

#

Class text_encoding is a trivially copyable type ([basic.types.general]).