[libcxx-commits] [libcxx] Implement P1885R12: `<text_encoding>` header (PR #141312)
William Tran-Viet via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jul 13 17:46:40 PDT 2025
https://github.com/smallp-o-p updated https://github.com/llvm/llvm-project/pull/141312
>From ed6239552023744cf0bb60e5967bb734640f0cdf Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Fri, 23 May 2025 22:08:36 -0400
Subject: [PATCH 1/9] Implement P1885R12
---
libcxx/docs/FeatureTestMacroTable.rst | 2 +-
libcxx/docs/Status/Cxx2cPapers.csv | 4 +-
libcxx/include/CMakeLists.txt | 2 +
libcxx/include/__locale | 9 +
.../include/__text_encoding/text_encoding.h | 1483 +++++++++++++++++
libcxx/include/module.modulemap.in | 7 +
libcxx/include/text_encoding | 68 +
libcxx/include/version | 2 +-
libcxx/modules/std.compat.cppm.in | 3 -
libcxx/modules/std.cppm.in | 6 +-
libcxx/modules/std/text_encoding.inc | 9 +-
libcxx/src/CMakeLists.txt | 1 +
libcxx/src/locale.cpp | 13 +
libcxx/src/text_encoding.cpp | 49 +
.../test/libcxx/transitive_includes/cxx26.csv | 15 +
.../text_encoding.version.compile.pass.cpp | 63 +
.../version.version.compile.pass.cpp | 16 +-
.../locale/locale.members/encoding.pass.cpp | 56 +
.../text_encoding.ctor/default.pass.cpp | 39 +
.../text_encoding.ctor/id.pass.cpp | 56 +
.../text_encoding.ctor/string_view.pass.cpp | 73 +
.../text_encoding.eq/equal.id.pass.cpp | 69 +
.../text_encoding.eq/equal.pass.cpp | 66 +
.../text_encoding.members/aliases.pass.cpp | 37 +
.../environment.pass.cpp | 83 +
.../text_encoding.members/literal.pass.cpp | 49 +
.../text_encoding.aliases_view/begin.pass.cpp | 66 +
.../text_encoding.aliases_view/empty.pass.cpp | 64 +
.../text_encoding.aliases_view/front.pass.cpp | 66 +
libcxx/test/support/test_text_encoding.h | 1173 +++++++++++++
.../generate_feature_test_macro_components.py | 1 -
libcxx/utils/libcxx/header_information.py | 1 -
32 files changed, 3622 insertions(+), 29 deletions(-)
create mode 100644 libcxx/include/__text_encoding/text_encoding.h
create mode 100644 libcxx/include/text_encoding
create mode 100644 libcxx/src/text_encoding.cpp
create mode 100644 libcxx/test/std/language.support/support.limits/support.limits.general/text_encoding.version.compile.pass.cpp
create mode 100644 libcxx/test/std/localization/locales/locale/locale.members/encoding.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp
create mode 100644 libcxx/test/support/test_text_encoding.h
diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index 61805726a4ff0..5eb2eb2848cee 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -510,7 +510,7 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_submdspan`` *unimplemented*
---------------------------------------------------------- -----------------
- ``__cpp_lib_text_encoding`` *unimplemented*
+ ``__cpp_lib_text_encoding`` ``202306L``
---------------------------------------------------------- -----------------
``__cpp_lib_to_chars`` *unimplemented*
---------------------------------------------------------- -----------------
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv b/libcxx/docs/Status/Cxx2cPapers.csv
index a1854a6acc41a..3eff34ca30990 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -13,7 +13,7 @@
"`P2013R5 <https://wg21.link/P2013R5>`__","Freestanding Language: Optional ``::operator new``","2023-06 (Varna)","","",""
"`P2363R5 <https://wg21.link/P2363R5>`__","Extending associative containers with the remaining heterogeneous overloads","2023-06 (Varna)","","",""
"`P1901R2 <https://wg21.link/P1901R2>`__","Enabling the Use of ``weak_ptr`` as Keys in Unordered Associative Containers","2023-06 (Varna)","","",""
-"`P1885R12 <https://wg21.link/P1885R12>`__","Naming Text Encodings to Demystify Them","2023-06 (Varna)","","",""
+"`P1885R12 <https://wg21.link/P1885R12>`__","Naming Text Encodings to Demystify Them","2023-06 (Varna)","|Complete|","21",""
"`P0792R14 <https://wg21.link/P0792R14>`__","``function_ref``: a type-erased callable reference","2023-06 (Varna)","","",""
"`P2874R2 <https://wg21.link/P2874R2>`__","P2874R2: Mandating Annex D Require No More","2023-06 (Varna)","|Complete|","12",""
"`P2757R3 <https://wg21.link/P2757R3>`__","Type-checking format args","2023-06 (Varna)","","",""
@@ -79,7 +79,7 @@
"`P3136R1 <https://wg21.link/P3136R1>`__","Retiring niebloids","2024-11 (Wrocław)","|Complete|","14",""
"`P3138R5 <https://wg21.link/P3138R5>`__","``views::cache_latest``","2024-11 (Wrocław)","","",""
"`P3379R0 <https://wg21.link/P3379R0>`__","Constrain ``std::expected`` equality operators","2024-11 (Wrocław)","|Complete|","21",""
-"`P2862R1 <https://wg21.link/P2862R1>`__","``text_encoding::name()`` should never return null values","2024-11 (Wrocław)","","",""
+"`P2862R1 <https://wg21.link/P2862R1>`__","``text_encoding::name()`` should never return null values","2024-11 (Wrocław)","|Complete|","21",""
"`P2897R7 <https://wg21.link/P2897R7>`__","``aligned_accessor``: An ``mdspan`` accessor expressing pointer over-alignment","2024-11 (Wrocław)","|Complete|","21",""
"`P3355R1 <https://wg21.link/P3355R1>`__","Fix ``submdspan`` for C++26","2024-11 (Wrocław)","","",""
"`P3222R0 <https://wg21.link/P3222R0>`__","Fix C++26 by adding transposed special cases for P2642 layouts","2024-11 (Wrocław)","","",""
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index c8e6d28584623..a1cb0ecddd3d6 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -762,6 +762,7 @@ set(files
__system_error/error_condition.h
__system_error/system_error.h
__system_error/throw_system_error.h
+ __text_encoding/text_encoding.h
__thread/formatter.h
__thread/id.h
__thread/jthread.h
@@ -1071,6 +1072,7 @@ set(files
strstream
syncstream
system_error
+ text_encoding
tgmath.h
thread
tuple
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index 757a53951f66e..268fdfdef2e5f 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -31,6 +31,10 @@
# include <cstddef>
# include <cstring>
+# if _LIBCPP_STD_VER >= 26
+# include <__text_encoding/text_encoding.h>
+# endif
+
# if _LIBCPP_HAS_WIDE_CHARACTERS
# include <cwchar>
# else
@@ -98,6 +102,11 @@ public:
// locale operations:
string name() const;
+
+# if _LIBCPP_STD_VER >= 26 && __CHAR_BIT__ == 8
+ text_encoding encoding() const;
+# endif // _LIBCPP_STD_VER >= 26
+
bool operator==(const locale&) const;
# if _LIBCPP_STD_VER <= 17
_LIBCPP_HIDE_FROM_ABI bool operator!=(const locale& __y) const { return !(*this == __y); }
diff --git a/libcxx/include/__text_encoding/text_encoding.h b/libcxx/include/__text_encoding/text_encoding.h
new file mode 100644
index 0000000000000..93d0ae2ab6b89
--- /dev/null
+++ b/libcxx/include/__text_encoding/text_encoding.h
@@ -0,0 +1,1483 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_H
+#define _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if _LIBCPP_HAS_LOCALIZATION
+
+#include <__algorithm/copy_n.h>
+#include <__algorithm/lower_bound.h>
+#include <__algorithm/min.h>
+#include <__functional/hash.h>
+#include <__iterator/iterator_traits.h>
+#include <__locale_dir/locale_base_api.h>
+#include <__ranges/view_interface.h>
+#include <__string/char_traits.h>
+#include <__utility/unreachable.h>
+#include <cstdint>
+#include <string_view>
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+#if _LIBCPP_STD_VER >= 26
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
+ static constexpr size_t max_name_length = 63;
+
+private:
+ struct __encoding_data {
+ using __id_rep _LIBCPP_NODEBUG = int_least32_t;
+ __id_rep __mib_rep;
+ const char* __name;
+
+ friend constexpr bool operator==(const __encoding_data& __e, const __encoding_data& __other) _NOEXCEPT {
+ return __e.__mib_rep == __other.__mib_rep || __comp_name(__e.__name, __other.__name);
+ }
+
+ friend constexpr bool operator<(const __encoding_data& __e, const __id_rep __i) _NOEXCEPT {
+ return __e.__mib_rep < __i;
+ }
+ };
+
+public:
+ enum class id : __encoding_data::__id_rep {
+ other = 1,
+ unknown = 2,
+ ASCII = 3,
+ ISOLatin1 = 4,
+ ISOLatin2 = 5,
+ ISOLatin3 = 6,
+ ISOLatin4 = 7,
+ ISOLatinCyrillic = 8,
+ ISOLatinArabic = 9,
+ ISOLatinGreek = 10,
+ ISOLatinHebrew = 11,
+ ISOLatin5 = 12,
+ ISOLatin6 = 13,
+ ISOTextComm = 14,
+ HalfWidthKatakana = 15,
+ JISEncoding = 16,
+ ShiftJIS = 17,
+ EUCPkdFmtJapanese = 18,
+ EUCFixWidJapanese = 19,
+ ISO4UnitedKingdom = 20,
+ ISO11SwedishForNames = 21,
+ ISO15Italian = 22,
+ ISO17Spanish = 23,
+ ISO21German = 24,
+ ISO60DanishNorwegian = 25,
+ ISO69French = 26,
+ ISO10646UTF1 = 27,
+ ISO646basic1983 = 28,
+ INVARIANT = 29,
+ ISO2IntlRefVersion = 30,
+ NATSSEFI = 31,
+ NATSSEFIADD = 32,
+ NATSDANO = 33,
+ NATSDANOADD = 34,
+ ISO10Swedish = 35,
+ KSC56011987 = 36,
+ ISO2022KR = 37,
+ EUCKR = 38,
+ ISO2022JP = 39,
+ ISO2022JP2 = 40,
+ ISO13JISC6220jp = 41,
+ ISO14JISC6220ro = 42,
+ ISO16Portuguese = 43,
+ ISO18Greek7Old = 44,
+ ISO19LatinGreek = 45,
+ ISO25French = 46,
+ ISO27LatinGreek1 = 47,
+ ISO5427Cyrillic = 48,
+ ISO42JISC62261978 = 49,
+ ISO47BSViewdata = 50,
+ ISO49INIS = 51,
+ ISO50INIS8 = 52,
+ ISO51INISCyrillic = 53,
+ ISO54271981 = 54,
+ ISO5428Greek = 55,
+ ISO57GB1988 = 56,
+ ISO58GB231280 = 57,
+ ISO61Norwegian2 = 58,
+ ISO70VideotexSupp1 = 59,
+ ISO84Portuguese2 = 60,
+ ISO85Spanish2 = 61,
+ ISO86Hungarian = 62,
+ ISO87JISX0208 = 63,
+ ISO88Greek7 = 64,
+ ISO89ASMO449 = 65,
+ ISO90 = 66,
+ ISO91JISC62291984a = 67,
+ ISO92JISC62991984b = 68,
+ ISO93JIS62291984badd = 69,
+ ISO94JIS62291984hand = 70,
+ ISO95JIS62291984handadd = 71,
+ ISO96JISC62291984kana = 72,
+ ISO2033 = 73,
+ ISO99NAPLPS = 74,
+ ISO102T617bit = 75,
+ ISO103T618bit = 76,
+ ISO111ECMACyrillic = 77,
+ ISO121Canadian1 = 78,
+ ISO122Canadian2 = 79,
+ ISO123CSAZ24341985gr = 80,
+ ISO88596E = 81,
+ ISO88596I = 82,
+ ISO128T101G2 = 83,
+ ISO88598E = 84,
+ ISO88598I = 85,
+ ISO139CSN369103 = 86,
+ ISO141JUSIB1002 = 87,
+ ISO143IECP271 = 88,
+ ISO146Serbian = 89,
+ ISO147Macedonian = 90,
+ ISO150 = 91,
+ ISO151Cuba = 92,
+ ISO6937Add = 93,
+ ISO153GOST1976874 = 94,
+ ISO8859Supp = 95,
+ ISO10367Box = 96,
+ ISO158Lap = 97,
+ ISO159JISX02121990 = 98,
+ ISO646Danish = 99,
+ USDK = 100,
+ DKUS = 101,
+ KSC5636 = 102,
+ Unicode11UTF7 = 103,
+ ISO2022CN = 104,
+ ISO2022CNEXT = 105,
+ UTF8 = 106,
+ ISO885913 = 109,
+ ISO885914 = 110,
+ ISO885915 = 111,
+ ISO885916 = 112,
+ GBK = 113,
+ GB18030 = 114,
+ OSDEBCDICDF0415 = 115,
+ OSDEBCDICDF03IRV = 116,
+ OSDEBCDICDF041 = 117,
+ ISO115481 = 118,
+ KZ1048 = 119,
+ UCS2 = 1000,
+ UCS4 = 1001,
+ UnicodeASCII = 1002,
+ UnicodeLatin1 = 1003,
+ UnicodeJapanese = 1004,
+ UnicodeIBM1261 = 1005,
+ UnicodeIBM1268 = 1006,
+ UnicodeIBM1276 = 1007,
+ UnicodeIBM1264 = 1008,
+ UnicodeIBM1265 = 1009,
+ Unicode11 = 1010,
+ SCSU = 1011,
+ UTF7 = 1012,
+ UTF16BE = 1013,
+ UTF16LE = 1014,
+ UTF16 = 1015,
+ CESU8 = 1016,
+ UTF32 = 1017,
+ UTF32BE = 1018,
+ UTF32LE = 1019,
+ BOCU1 = 1020,
+ UTF7IMAP = 1021,
+ Windows30Latin1 = 2000,
+ Windows31Latin1 = 2001,
+ Windows31Latin2 = 2002,
+ Windows31Latin5 = 2003,
+ HPRoman8 = 2004,
+ AdobeStandardEncoding = 2005,
+ VenturaUS = 2006,
+ VenturaInternational = 2007,
+ DECMCS = 2008,
+ PC850Multilingual = 2009,
+ PC8DanishNorwegian = 2012,
+ PC862LatinHebrew = 2013,
+ PC8Turkish = 2014,
+ IBMSymbols = 2015,
+ IBMThai = 2016,
+ HPLegal = 2017,
+ HPPiFont = 2018,
+ HPMath8 = 2019,
+ HPPSMath = 2020,
+ HPDesktop = 2021,
+ VenturaMath = 2022,
+ MicrosoftPublishing = 2023,
+ Windows31J = 2024,
+ GB2312 = 2025,
+ Big5 = 2026,
+ Macintosh = 2027,
+ IBM037 = 2028,
+ IBM038 = 2029,
+ IBM273 = 2030,
+ IBM274 = 2031,
+ IBM275 = 2032,
+ IBM277 = 2033,
+ IBM278 = 2034,
+ IBM280 = 2035,
+ IBM281 = 2036,
+ IBM284 = 2037,
+ IBM285 = 2038,
+ IBM290 = 2039,
+ IBM297 = 2040,
+ IBM420 = 2041,
+ IBM423 = 2042,
+ IBM424 = 2043,
+ PC8CodePage437 = 2011,
+ IBM500 = 2044,
+ IBM851 = 2045,
+ PCp852 = 2010,
+ IBM855 = 2046,
+ IBM857 = 2047,
+ IBM860 = 2048,
+ IBM861 = 2049,
+ IBM863 = 2050,
+ IBM864 = 2051,
+ IBM865 = 2052,
+ IBM868 = 2053,
+ IBM869 = 2054,
+ IBM870 = 2055,
+ IBM871 = 2056,
+ IBM880 = 2057,
+ IBM891 = 2058,
+ IBM903 = 2059,
+ IBBM904 = 2060,
+ IBM905 = 2061,
+ IBM918 = 2062,
+ IBM1026 = 2063,
+ IBMEBCDICATDE = 2064,
+ EBCDICATDEA = 2065,
+ EBCDICCAFR = 2066,
+ EBCDICDKNO = 2067,
+ EBCDICDKNOA = 2068,
+ EBCDICFISE = 2069,
+ EBCDICFISEA = 2070,
+ EBCDICFR = 2071,
+ EBCDICIT = 2072,
+ EBCDICPT = 2073,
+ EBCDICES = 2074,
+ EBCDICESA = 2075,
+ EBCDICESS = 2076,
+ EBCDICUK = 2077,
+ EBCDICUS = 2078,
+ Unknown8BiT = 2079,
+ Mnemonic = 2080,
+ Mnem = 2081,
+ VISCII = 2082,
+ VIQR = 2083,
+ KOI8R = 2084,
+ HZGB2312 = 2085,
+ IBM866 = 2086,
+ PC775Baltic = 2087,
+ KOI8U = 2088,
+ IBM00858 = 2089,
+ IBM00924 = 2090,
+ IBM01140 = 2091,
+ IBM01141 = 2092,
+ IBM01142 = 2093,
+ IBM01143 = 2094,
+ IBM01144 = 2095,
+ IBM01145 = 2096,
+ IBM01146 = 2097,
+ IBM01147 = 2098,
+ IBM01148 = 2099,
+ IBM01149 = 2100,
+ Big5HKSCS = 2101,
+ IBM1047 = 2102,
+ PTCP154 = 2103,
+ Amiga1251 = 2104,
+ KOI7switched = 2105,
+ BRF = 2106,
+ TSCII = 2107,
+ CP51932 = 2108,
+ windows874 = 2109,
+ windows1250 = 2250,
+ windows1251 = 2251,
+ windows1252 = 2252,
+ windows1253 = 2253,
+ windows1254 = 2254,
+ windows1255 = 2255,
+ windows1256 = 2256,
+ windows1257 = 2257,
+ windows1258 = 2258,
+ TIS620 = 2259,
+ CP50220 = 2260,
+ reserved = 3000
+ };
+
+ using enum id;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr text_encoding() = default;
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit text_encoding(string_view __enc) _NOEXCEPT
+ : __encoding_rep_(__find_encoding_data(__enc)) {
+ __enc.copy(__name_, max_name_length, 0);
+ }
+ _LIBCPP_HIDE_FROM_ABI constexpr text_encoding(id __i) _NOEXCEPT : __encoding_rep_(__find_encoding_data_by_id(__i)) {
+ if (__encoding_rep_->__name[0] != '\0')
+ std::copy_n(__encoding_rep_->__name, std::char_traits<char>::length(__encoding_rep_->__name), __name_);
+ }
+
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr id mib() const _NOEXCEPT { return id(__encoding_rep_->__mib_rep); }
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const char* name() const _NOEXCEPT { return __name_; }
+
+ // [text.encoding.aliases], class text_encoding::aliases_view
+ struct aliases_view : ranges::view_interface<aliases_view> {
+ constexpr aliases_view() = default;
+ constexpr aliases_view(const __encoding_data* __d) : __view_data_(__d) {}
+ struct __end_sentinel {};
+ struct __iterator {
+ using value_type = const char*;
+ using reference = const char*;
+ using difference_type = ptrdiff_t;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator() noexcept = default;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const {
+ if (__can_dereference())
+ return __data_->__name;
+ std::unreachable();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr value_type operator[](difference_type __n) const {
+ auto __it = *this;
+ return *(__it + __n);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(__iterator __it, difference_type __n) {
+ __it += __n;
+ return __it;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator+(difference_type __n, __iterator __it) {
+ __it += __n;
+ return __it;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(__iterator __it, difference_type __n) {
+ __it -= __n;
+ return __it;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr difference_type operator-(const __iterator& __other) const
+ {
+ if(__other.__mib_rep_ == __mib_rep_)
+ return __mib_rep_ - __other.__mib_rep_;
+ std::unreachable();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(difference_type __n, __iterator& __it) {
+ __it -= __n;
+ return __it;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator++() {
+ __data_++;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator++(int) {
+ auto __old = *this;
+ __data_++;
+ return __old;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator--() {
+ __data_--;
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator operator--(int) {
+ auto __old = *this;
+ __data_--;
+ return __old;
+ }
+
+ // Check if going past the encoding data list array and if the new index has the same id, if not then
+ // replace it with a sentinel "out-of-bounds" iterator.
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __n) {
+ if (__data_) [[__likely__]] {
+ if (__n > 0) {
+ if ((__data_ + __n) < std::end(__text_encoding_data) && __data_[__n - 1].__mib_rep == __mib_rep_)
+ __data_ += __n;
+ else
+ *this = __iterator{};
+ } else if (__n < 0) {
+ if ((__data_ + __n) > __text_encoding_data && __data_[__n].__mib_rep == __mib_rep_)
+ __data_ += __n;
+ else
+ *this = __iterator{};
+ }
+ }
+ return *this;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator-=(difference_type __n) { return operator+=(-__n); }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const __iterator& __it) const {
+ return __data_ == __it.__data_ && __it.__mib_rep_ == __mib_rep_;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr bool operator==(__end_sentinel) const { return !__can_dereference(); }
+
+ _LIBCPP_HIDE_FROM_ABI constexpr auto operator<=>(__iterator __it) const { return __data_ <=> __it.__data_; }
+
+ private:
+ friend struct text_encoding;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator(const __encoding_data* __enc_d) noexcept
+ : __data_(__enc_d), __mib_rep_(__enc_d ? __enc_d->__mib_rep : 0) {}
+
+ _LIBCPP_HIDE_FROM_ABI bool __can_dereference() const { return __data_ && __data_->__mib_rep == __mib_rep_; }
+
+ // default iterator is a sentinel
+ const __encoding_data* __data_ = nullptr;
+ __encoding_data::__id_rep __mib_rep_ = 0;
+ };
+
+ constexpr __iterator begin() const { return __iterator{__view_data_}; }
+ constexpr __end_sentinel end() const { return __end_sentinel{}; }
+
+ private:
+ const __encoding_data* __view_data_ = nullptr;
+ };
+
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr aliases_view aliases() const _NOEXCEPT {
+ auto __rep = __encoding_rep_ - 1;
+ if (__encoding_rep_->__name[0]) {
+ while (__rep > std::begin(__text_encoding_data) && (__rep--)->__mib_rep == __encoding_rep_->__mib_rep)
+ ;
+ } else {
+ __rep = nullptr;
+ }
+
+ return aliases_view(__rep);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const text_encoding& __a, const text_encoding& __b) _NOEXCEPT {
+ if (__a.mib() == id::other && __b.mib() == id::other)
+ return __comp_name(__a.__name_, __b.__name_);
+
+ return __a.mib() == __b.mib();
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const text_encoding& __encoding, id __i) _NOEXCEPT {
+ return __encoding.mib() == __i;
+ }
+
+# if __CHAR_BIT__ == 8
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static consteval text_encoding literal() _NOEXCEPT {
+# ifdef __GNUC_EXECUTION_CHARSET_NAME
+ return text_encoding(__GNUC_EXECUTION_CHARSET_NAME);
+# elif defined(__clang_literal_encoding__)
+ return text_encoding(__clang_literal_encoding__);
+# elif defined(__clang__)
+ return text_encoding(id::UTF8);
+# else
+ return {};
+# endif
+ }
+
+ [[nodiscard]] static text_encoding environment();
+
+ template <id __i>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool environment_is() {
+ return environment() == __i;
+ }
+
+# else
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static consteval text_encoding literal() = delete;
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static text_encoding environment() = delete;
+ template <id __i>
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool environment_is() = delete;
+# endif
+
+private:
+ _LIBCPP_HIDE_FROM_ABI static constexpr bool __comp_name(string_view __a, string_view __b) {
+ if (__a.empty() || __b.empty()) {
+ return false;
+ }
+
+ // map any non-alphanumeric character to 255, skip prefix 0s, else get tolower(__n)
+ auto __map_char = [](char __n, bool& __in_number) -> unsigned char {
+ auto __to_lower = [](char __n) -> char { return (__n >= 'A' && __n <= 'Z') ? __n + ('a' - 'A') : __n; };
+ if (__n == '0') {
+ return __in_number ? '0' : 255;
+ }
+ __in_number = __n >= '1' && __n <= '9';
+ return (__n >= '1' && __n <= '9') || (__n >= 'A' && __n <= 'Z') || (__n >= 'a' && __n <= 'z')
+ ? __to_lower(__n)
+ : 255;
+ };
+
+ auto __a_ptr = __a.begin(), __b_ptr = __b.begin();
+ bool __a_in_number = false, __b_in_number = false;
+
+ unsigned char __a_val = 255, __b_val = 255;
+ for (;; __a_ptr++, __b_ptr++) {
+ while ((__a_val = __map_char(*__a_ptr, __a_in_number)) == 255 && __a_ptr != __a.end())
+ __a_ptr++;
+ while ((__b_val = __map_char(*__b_ptr, __b_in_number)) == 255 && __b_ptr != __b.end())
+ __b_ptr++;
+
+ if (__a_ptr == __a.end())
+ return __b_ptr == __b.end();
+ if (__b_ptr == __b.end())
+ return false;
+ if (__a_val != __b_val)
+ return false;
+ }
+ return true;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI static constexpr const __encoding_data* __find_encoding_data(string_view __a) {
+ auto __data_ptr = __text_encoding_data + 2, __data_last = std::end(__text_encoding_data) - 1;
+
+ for (; __data_ptr != __data_last; __data_ptr++) {
+ if (__comp_name(__a, __data_ptr->__name)) {
+ const auto __found_id = __data_ptr->__mib_rep;
+ while (__data_ptr[-1].__mib_rep == __found_id)
+ __data_ptr--;
+ return __data_ptr;
+ }
+ }
+
+ return __text_encoding_data; // other
+ }
+
+ _LIBCPP_HIDE_FROM_ABI static constexpr const __encoding_data* __find_encoding_data_by_id(id __i) {
+ auto __found = std::lower_bound(
+ std::begin(__text_encoding_data), std::end(__text_encoding_data) - 1, __encoding_data::__id_rep(__i));
+ return __found != std::end(__text_encoding_data) - 1 ? __found : __text_encoding_data + 1; // unknown
+ }
+
+ _LIBCPP_HIDE_FROM_ABI static constexpr __encoding_data __text_encoding_data[] = {
+ {1, ""},
+ {2, ""},
+ {3, "ANSI_X3.4-1968"},
+ {3, "ANSI_X3.4-1986"},
+ {3, "IBM367"},
+ {3, "ISO646-US"},
+ {3, "ISO_646.irv:1991"},
+ {3, "cp367"},
+ {3, "csASCII"},
+ {3, "iso-ir-6"},
+ {3, "us"},
+ {4, "ISO-8859-1"},
+ {4, "ISO_8859-1:1987"},
+ {4, "CP819"},
+ {4, "IBM819"},
+ {4, "ISO_8859-1"},
+ {4, "csISOLatin1"},
+ {4, "iso-ir-100"},
+ {4, "l1"},
+ {4, "latin1"},
+ {5, "ISO-8859-2"},
+ {5, "ISO_8859-2:1987"},
+ {5, "ISO_8859-2"},
+ {5, "csISOLatin2"},
+ {5, "iso-ir-101"},
+ {5, "l2"},
+ {5, "latin2"},
+ {6, "ISO-8859-3"},
+ {6, "ISO_8859-3:1988"},
+ {6, "ISO_8859-3"},
+ {6, "csISOLatin3"},
+ {6, "iso-ir-109"},
+ {6, "l3"},
+ {6, "latin3"},
+ {7, "ISO-8859-4"},
+ {7, "ISO_8859-4:1988"},
+ {7, "ISO_8859-4"},
+ {7, "csISOLatin4"},
+ {7, "iso-ir-110"},
+ {7, "l4"},
+ {7, "latin4"},
+ {8, "ISO-8859-5"},
+ {8, "ISO_8859-5:1988"},
+ {8, "ISO_8859-5"},
+ {8, "csISOLatinCyrillic"},
+ {8, "cyrillic"},
+ {8, "iso-ir-144"},
+ {9, "ISO-8859-6"},
+ {9, "ISO_8859-6:1987"},
+ {9, "ASMO-708"},
+ {9, "ECMA-114"},
+ {9, "ISO_8859-6"},
+ {9, "arabic"},
+ {9, "csISOLatinArabic"},
+ {9, "iso-ir-127"},
+ {10, "ISO-8859-7"},
+ {10, "ISO_8859-7:1987"},
+ {10, "ECMA-118"},
+ {10, "ELOT_928"},
+ {10, "ISO_8859-7"},
+ {10, "csISOLatinGreek"},
+ {10, "greek"},
+ {10, "greek8"},
+ {10, "iso-ir-126"},
+ {11, "ISO-8859-8"},
+ {11, "ISO_8859-8:1988"},
+ {11, "ISO_8859-8"},
+ {11, "csISOLatinHebrew"},
+ {11, "hebrew"},
+ {11, "iso-ir-138"},
+ {12, "ISO-8859-9"},
+ {12, "ISO_8859-9:1989"},
+ {12, "ISO_8859-9"},
+ {12, "csISOLatin5"},
+ {12, "iso-ir-148"},
+ {12, "l5"},
+ {12, "latin5"},
+ {13, "ISO-8859-10"},
+ {13, "ISO_8859-10:1992"},
+ {13, "csISOLatin6"},
+ {13, "iso-ir-157"},
+ {13, "l6"},
+ {13, "latin6"},
+ {14, "ISO_6937-2-add"},
+ {14, "csISOTextComm"},
+ {14, "iso-ir-142"},
+ {15, "JIS_X0201"},
+ {15, "X0201"},
+ {15, "csHalfWidthKatakana"},
+ {16, "JIS_Encoding"},
+ {16, "csJISEncoding"},
+ {17, "Shift_JIS"},
+ {17, "MS_Kanji"},
+ {17, "csShiftJIS"},
+ {18, "EUC-JP"},
+ {18, "Extended_UNIX_Code_Packed_Format_for_Japanese"},
+ {18, "csEUCPkdFmtJapanese"},
+ {19, "Extended_UNIX_Code_Fixed_Width_for_Japanese"},
+ {19, "csEUCFixWidJapanese"},
+ {20, "BS_4730"},
+ {20, "ISO646-GB"},
+ {20, "csISO4UnitedKingdom"},
+ {20, "gb"},
+ {20, "iso-ir-4"},
+ {20, "uk"},
+ {21, "SEN_850200_C"},
+ {21, "ISO646-SE2"},
+ {21, "csISO11SwedishForNames"},
+ {21, "iso-ir-11"},
+ {21, "se2"},
+ {22, "IT"},
+ {22, "ISO646-IT"},
+ {22, "csISO15Italian"},
+ {22, "iso-ir-15"},
+ {23, "ES"},
+ {23, "ISO646-ES"},
+ {23, "csISO17Spanish"},
+ {23, "iso-ir-17"},
+ {24, "DIN_66003"},
+ {24, "ISO646-DE"},
+ {24, "csISO21German"},
+ {24, "de"},
+ {24, "iso-ir-21"},
+ {25, "NS_4551-1"},
+ {25, "ISO646-NO"},
+ {25, "csISO60DanishNorwegian"},
+ {25, "csISO60Norwegian1"},
+ {25, "iso-ir-60"},
+ {25, "no"},
+ {26, "NF_Z_62-010"},
+ {26, "ISO646-FR"},
+ {26, "csISO69French"},
+ {26, "fr"},
+ {26, "iso-ir-69"},
+ {27, "ISO-10646-UTF-1"},
+ {27, "csISO10646UTF1"},
+ {28, "ISO_646.basic:1983"},
+ {28, "csISO646basic1983"},
+ {28, "ref"},
+ {29, "INVARIANT"},
+ {29, "csINVARIANT"},
+ {30, "ISO_646.irv:1983"},
+ {30, "csISO2IntlRefVersion"},
+ {30, "irv"},
+ {30, "iso-ir-2"},
+ {31, "NATS-SEFI"},
+ {31, "csNATSSEFI"},
+ {31, "iso-ir-8-1"},
+ {32, "NATS-SEFI-ADD"},
+ {32, "csNATSSEFIADD"},
+ {32, "iso-ir-8-2"},
+ {33, "NATS-DANO"},
+ {33, "csNATSDANO"},
+ {33, "iso-ir-9-1"},
+ {34, "NATS-DANO-ADD"},
+ {34, "csNATSDANOADD"},
+ {34, "iso-ir-9-2"},
+ {35, "SEN_850200_B"},
+ {35, "FI"},
+ {35, "ISO646-FI"},
+ {35, "ISO646-SE"},
+ {35, "csISO10Swedish"},
+ {35, "iso-ir-10"},
+ {35, "se"},
+ {36, "KS_C_5601-1987"},
+ {36, "KSC_5601"},
+ {36, "KS_C_5601-1989"},
+ {36, "csKSC56011987"},
+ {36, "iso-ir-149"},
+ {36, "korean"},
+ {37, "ISO-2022-KR"},
+ {37, "csISO2022KR"},
+ {38, "EUC-KR"},
+ {38, "csEUCKR"},
+ {39, "ISO-2022-JP"},
+ {39, "csISO2022JP"},
+ {40, "ISO-2022-JP-2"},
+ {40, "csISO2022JP2"},
+ {41, "JIS_C6220-1969-jp"},
+ {41, "JIS_C6220-1969"},
+ {41, "csISO13JISC6220jp"},
+ {41, "iso-ir-13"},
+ {41, "katakana"},
+ {41, "x0201-7"},
+ {42, "JIS_C6220-1969-ro"},
+ {42, "ISO646-JP"},
+ {42, "csISO14JISC6220ro"},
+ {42, "iso-ir-14"},
+ {42, "jp"},
+ {43, "PT"},
+ {43, "ISO646-PT"},
+ {43, "csISO16Portuguese"},
+ {43, "iso-ir-16"},
+ {44, "greek7-old"},
+ {44, "csISO18Greek7Old"},
+ {44, "iso-ir-18"},
+ {45, "latin-greek"},
+ {45, "csISO19LatinGreek"},
+ {45, "iso-ir-19"},
+ {46, "NF_Z_62-010_(1973)"},
+ {46, "ISO646-FR1"},
+ {46, "csISO25French"},
+ {46, "iso-ir-25"},
+ {47, "Latin-greek-1"},
+ {47, "csISO27LatinGreek1"},
+ {47, "iso-ir-27"},
+ {48, "ISO_5427"},
+ {48, "csISO5427Cyrillic"},
+ {48, "iso-ir-37"},
+ {49, "JIS_C6226-1978"},
+ {49, "csISO42JISC62261978"},
+ {49, "iso-ir-42"},
+ {50, "BS_viewdata"},
+ {50, "csISO47BSViewdata"},
+ {50, "iso-ir-47"},
+ {51, "INIS"},
+ {51, "csISO49INIS"},
+ {51, "iso-ir-49"},
+ {52, "INIS-8"},
+ {52, "csISO50INIS8"},
+ {52, "iso-ir-50"},
+ {53, "INIS-cyrillic"},
+ {53, "csISO51INISCyrillic"},
+ {53, "iso-ir-51"},
+ {54, "ISO_5427:1981"},
+ {54, "ISO5427Cyrillic1981"},
+ {54, "csISO54271981"},
+ {54, "iso-ir-54"},
+ {55, "ISO_5428:1980"},
+ {55, "csISO5428Greek"},
+ {55, "iso-ir-55"},
+ {56, "GB_1988-80"},
+ {56, "ISO646-CN"},
+ {56, "cn"},
+ {56, "csISO57GB1988"},
+ {56, "iso-ir-57"},
+ {57, "GB_2312-80"},
+ {57, "chinese"},
+ {57, "csISO58GB231280"},
+ {57, "iso-ir-58"},
+ {58, "NS_4551-2"},
+ {58, "ISO646-NO2"},
+ {58, "csISO61Norwegian2"},
+ {58, "iso-ir-61"},
+ {58, "no2"},
+ {59, "videotex-suppl"},
+ {59, "csISO70VideotexSupp1"},
+ {59, "iso-ir-70"},
+ {60, "PT2"},
+ {60, "ISO646-PT2"},
+ {60, "csISO84Portuguese2"},
+ {60, "iso-ir-84"},
+ {61, "ES2"},
+ {61, "ISO646-ES2"},
+ {61, "csISO85Spanish2"},
+ {61, "iso-ir-85"},
+ {62, "MSZ_7795.3"},
+ {62, "ISO646-HU"},
+ {62, "csISO86Hungarian"},
+ {62, "hu"},
+ {62, "iso-ir-86"},
+ {63, "JIS_C6226-1983"},
+ {63, "JIS_X0208-1983"},
+ {63, "csISO87JISX0208"},
+ {63, "iso-ir-87"},
+ {63, "x0208"},
+ {64, "greek7"},
+ {64, "csISO88Greek7"},
+ {64, "iso-ir-88"},
+ {65, "ASMO_449"},
+ {65, "ISO_9036"},
+ {65, "arabic7"},
+ {65, "csISO89ASMO449"},
+ {65, "iso-ir-89"},
+ {66, "iso-ir-90"},
+ {66, "csISO90"},
+ {67, "JIS_C6229-1984-a"},
+ {67, "csISO91JISC62291984a"},
+ {67, "iso-ir-91"},
+ {67, "jp-ocr-a"},
+ {68, "JIS_C6229-1984-b"},
+ {68, "ISO646-JP-OCR-B"},
+ {68, "csISO92JISC62991984b"},
+ {68, "iso-ir-92"},
+ {68, "jp-ocr-b"},
+ {69, "JIS_C6229-1984-b-add"},
+ {69, "csISO93JIS62291984badd"},
+ {69, "iso-ir-93"},
+ {69, "jp-ocr-b-add"},
+ {70, "JIS_C6229-1984-hand"},
+ {70, "csISO94JIS62291984hand"},
+ {70, "iso-ir-94"},
+ {70, "jp-ocr-hand"},
+ {71, "JIS_C6229-1984-hand-add"},
+ {71, "csISO95JIS62291984handadd"},
+ {71, "iso-ir-95"},
+ {71, "jp-ocr-hand-add"},
+ {72, "JIS_C6229-1984-kana"},
+ {72, "csISO96JISC62291984kana"},
+ {72, "iso-ir-96"},
+ {73, "ISO_2033-1983"},
+ {73, "csISO2033"},
+ {73, "e13b"},
+ {73, "iso-ir-98"},
+ {74, "ANSI_X3.110-1983"},
+ {74, "CSA_T500-1983"},
+ {74, "NAPLPS"},
+ {74, "csISO99NAPLPS"},
+ {74, "iso-ir-99"},
+ {75, "T.61-7bit"},
+ {75, "csISO102T617bit"},
+ {75, "iso-ir-102"},
+ {76, "T.61-8bit"},
+ {76, "T.61"},
+ {76, "csISO103T618bit"},
+ {76, "iso-ir-103"},
+ {77, "ECMA-cyrillic"},
+ {77, "KOI8-E"},
+ {77, "csISO111ECMACyrillic"},
+ {77, "iso-ir-111"},
+ {78, "CSA_Z243.4-1985-1"},
+ {78, "ISO646-CA"},
+ {78, "ca"},
+ {78, "csISO121Canadian1"},
+ {78, "csa7-1"},
+ {78, "csa71"},
+ {78, "iso-ir-121"},
+ {79, "CSA_Z243.4-1985-2"},
+ {79, "ISO646-CA2"},
+ {79, "csISO122Canadian2"},
+ {79, "csa7-2"},
+ {79, "csa72"},
+ {79, "iso-ir-122"},
+ {80, "CSA_Z243.4-1985-gr"},
+ {80, "csISO123CSAZ24341985gr"},
+ {80, "iso-ir-123"},
+ {81, "ISO-8859-6-E"},
+ {81, "ISO_8859-6-E"},
+ {81, "csISO88596E"},
+ {82, "ISO-8859-6-I"},
+ {82, "ISO_8859-6-I"},
+ {82, "csISO88596I"},
+ {83, "T.101-G2"},
+ {83, "csISO128T101G2"},
+ {83, "iso-ir-128"},
+ {84, "ISO-8859-8-E"},
+ {84, "ISO_8859-8-E"},
+ {84, "csISO88598E"},
+ {85, "ISO-8859-8-I"},
+ {85, "ISO_8859-8-I"},
+ {85, "csISO88598I"},
+ {86, "CSN_369103"},
+ {86, "csISO139CSN369103"},
+ {86, "iso-ir-139"},
+ {87, "JUS_I.B1.002"},
+ {87, "ISO646-YU"},
+ {87, "csISO141JUSIB1002"},
+ {87, "iso-ir-141"},
+ {87, "js"},
+ {87, "yu"},
+ {88, "IEC_P27-1"},
+ {88, "csISO143IECP271"},
+ {88, "iso-ir-143"},
+ {89, "JUS_I.B1.003-serb"},
+ {89, "csISO146Serbian"},
+ {89, "iso-ir-146"},
+ {89, "serbian"},
+ {90, "JUS_I.B1.003-mac"},
+ {90, "csISO147Macedonian"},
+ {90, "iso-ir-147"},
+ {90, "macedonian"},
+ {91, "greek-ccitt"},
+ {91, "csISO150"},
+ {91, "csISO150GreekCCITT"},
+ {91, "iso-ir-150"},
+ {92, "NC_NC00-10:81"},
+ {92, "ISO646-CU"},
+ {92, "csISO151Cuba"},
+ {92, "cuba"},
+ {92, "iso-ir-151"},
+ {93, "ISO_6937-2-25"},
+ {93, "csISO6937Add"},
+ {93, "iso-ir-152"},
+ {94, "GOST_19768-74"},
+ {94, "ST_SEV_358-88"},
+ {94, "csISO153GOST1976874"},
+ {94, "iso-ir-153"},
+ {95, "ISO_8859-supp"},
+ {95, "csISO8859Supp"},
+ {95, "iso-ir-154"},
+ {95, "latin1-2-5"},
+ {96, "ISO_10367-box"},
+ {96, "csISO10367Box"},
+ {96, "iso-ir-155"},
+ {97, "latin-lap"},
+ {97, "csISO158Lap"},
+ {97, "iso-ir-158"},
+ {97, "lap"},
+ {98, "JIS_X0212-1990"},
+ {98, "csISO159JISX02121990"},
+ {98, "iso-ir-159"},
+ {98, "x0212"},
+ {99, "DS_2089"},
+ {99, "DS2089"},
+ {99, "ISO646-DK"},
+ {99, "csISO646Danish"},
+ {99, "dk"},
+ {100, "us-dk"},
+ {100, "csUSDK"},
+ {101, "dk-us"},
+ {101, "csDKUS"},
+ {102, "KSC5636"},
+ {102, "ISO646-KR"},
+ {102, "csKSC5636"},
+ {103, "UNICODE-1-1-UTF-7"},
+ {103, "csUnicode11UTF7"},
+ {104, "ISO-2022-CN"},
+ {104, "csISO2022CN"},
+ {105, "ISO-2022-CN-EXT"},
+ {105, "csISO2022CNEXT"},
+ {106, "UTF-8"},
+ {106, "csUTF8"},
+ {109, "ISO-8859-13"},
+ {109, "csISO885913"},
+ {110, "ISO-8859-14"},
+ {110, "ISO_8859-14"},
+ {110, "ISO_8859-14:1998"},
+ {110, "csISO885914"},
+ {110, "iso-celtic"},
+ {110, "iso-ir-199"},
+ {110, "l8"},
+ {110, "latin8"},
+ {111, "ISO-8859-15"},
+ {111, "ISO_8859-15"},
+ {111, "Latin-9"},
+ {111, "csISO885915"},
+ {112, "ISO-8859-16"},
+ {112, "ISO_8859-16"},
+ {112, "ISO_8859-16:2001"},
+ {112, "csISO885916"},
+ {112, "iso-ir-226"},
+ {112, "l10"},
+ {112, "latin10"},
+ {113, "GBK"},
+ {113, "CP936"},
+ {113, "MS936"},
+ {113, "csGBK"},
+ {113, "windows-936"},
+ {114, "GB18030"},
+ {114, "csGB18030"},
+ {115, "OSD_EBCDIC_DF04_15"},
+ {115, "csOSDEBCDICDF0415"},
+ {116, "OSD_EBCDIC_DF03_IRV"},
+ {116, "csOSDEBCDICDF03IRV"},
+ {117, "OSD_EBCDIC_DF04_1"},
+ {117, "csOSDEBCDICDF041"},
+ {118, "ISO-11548-1"},
+ {118, "ISO_11548-1"},
+ {118, "ISO_TR_11548-1"},
+ {118, "csISO115481"},
+ {119, "KZ-1048"},
+ {119, "RK1048"},
+ {119, "STRK1048-2002"},
+ {119, "csKZ1048"},
+ {1000, "ISO-10646-UCS-2"},
+ {1000, "csUnicode"},
+ {1001, "ISO-10646-UCS-4"},
+ {1001, "csUCS4"},
+ {1002, "ISO-10646-UCS-Basic"},
+ {1002, "csUnicodeASCII"},
+ {1003, "ISO-10646-Unicode-Latin1"},
+ {1003, "ISO-10646"},
+ {1003, "csUnicodeLatin1"},
+ {1004, "ISO-10646-J-1"},
+ {1004, "csUnicodeJapanese"},
+ {1005, "ISO-Unicode-IBM-1261"},
+ {1005, "csUnicodeIBM1261"},
+ {1006, "ISO-Unicode-IBM-1268"},
+ {1006, "csUnicodeIBM1268"},
+ {1007, "ISO-Unicode-IBM-1276"},
+ {1007, "csUnicodeIBM1276"},
+ {1008, "ISO-Unicode-IBM-1264"},
+ {1008, "csUnicodeIBM1264"},
+ {1009, "ISO-Unicode-IBM-1265"},
+ {1009, "csUnicodeIBM1265"},
+ {1010, "UNICODE-1-1"},
+ {1010, "csUnicode11"},
+ {1011, "SCSU"},
+ {1011, "csSCSU"},
+ {1012, "UTF-7"},
+ {1012, "csUTF7"},
+ {1013, "UTF-16BE"},
+ {1013, "csUTF16BE"},
+ {1014, "UTF-16LE"},
+ {1014, "csUTF16LE"},
+ {1015, "UTF-16"},
+ {1015, "csUTF16"},
+ {1016, "CESU-8"},
+ {1016, "csCESU-8"},
+ {1016, "csCESU8"},
+ {1017, "UTF-32"},
+ {1017, "csUTF32"},
+ {1018, "UTF-32BE"},
+ {1018, "csUTF32BE"},
+ {1019, "UTF-32LE"},
+ {1019, "csUTF32LE"},
+ {1020, "BOCU-1"},
+ {1020, "csBOCU-1"},
+ {1020, "csBOCU1"},
+ {1021, "UTF-7-IMAP"},
+ {1021, "csUTF7IMAP"},
+ {2000, "ISO-8859-1-Windows-3.0-Latin-1"},
+ {2000, "csWindows30Latin1"},
+ {2001, "ISO-8859-1-Windows-3.1-Latin-1"},
+ {2001, "csWindows31Latin1"},
+ {2002, "ISO-8859-2-Windows-Latin-2"},
+ {2002, "csWindows31Latin2"},
+ {2003, "ISO-8859-9-Windows-Latin-5"},
+ {2003, "csWindows31Latin5"},
+ {2004, "hp-roman8"},
+ {2004, "csHPRoman8"},
+ {2004, "r8"},
+ {2004, "roman8"},
+ {2005, "Adobe-Standard-Encoding"},
+ {2005, "csAdobeStandardEncoding"},
+ {2006, "Ventura-US"},
+ {2006, "csVenturaUS"},
+ {2007, "Ventura-International"},
+ {2007, "csVenturaInternational"},
+ {2008, "DEC-MCS"},
+ {2008, "csDECMCS"},
+ {2008, "dec"},
+ {2009, "IBM850"},
+ {2009, "850"},
+ {2009, "cp850"},
+ {2009, "csPC850Multilingual"},
+ {2010, "IBM852"},
+ {2010, "852"},
+ {2010, "cp852"},
+ {2010, "csPCp852"},
+ {2011, "IBM437"},
+ {2011, "437"},
+ {2011, "cp437"},
+ {2011, "csPC8CodePage437"},
+ {2012, "PC8-Danish-Norwegian"},
+ {2012, "csPC8DanishNorwegian"},
+ {2013, "IBM862"},
+ {2013, "862"},
+ {2013, "cp862"},
+ {2013, "csPC862LatinHebrew"},
+ {2014, "PC8-Turkish"},
+ {2014, "csPC8Turkish"},
+ {2015, "IBM-Symbols"},
+ {2015, "csIBMSymbols"},
+ {2016, "IBM-Thai"},
+ {2016, "csIBMThai"},
+ {2017, "HP-Legal"},
+ {2017, "csHPLegal"},
+ {2018, "HP-Pi-font"},
+ {2018, "csHPPiFont"},
+ {2019, "HP-Math8"},
+ {2019, "csHPMath8"},
+ {2020, "Adobe-Symbol-Encoding"},
+ {2020, "csHPPSMath"},
+ {2021, "HP-DeskTop"},
+ {2021, "csHPDesktop"},
+ {2022, "Ventura-Math"},
+ {2022, "csVenturaMath"},
+ {2023, "Microsoft-Publishing"},
+ {2023, "csMicrosoftPublishing"},
+ {2024, "Windows-31J"},
+ {2024, "csWindows31J"},
+ {2025, "GB2312"},
+ {2025, "csGB2312"},
+ {2026, "Big5"},
+ {2026, "csBig5"},
+ {2027, "macintosh"},
+ {2027, "csMacintosh"},
+ {2027, "mac"},
+ {2028, "IBM037"},
+ {2028, "cp037"},
+ {2028, "csIBM037"},
+ {2028, "ebcdic-cp-ca"},
+ {2028, "ebcdic-cp-nl"},
+ {2028, "ebcdic-cp-us"},
+ {2028, "ebcdic-cp-wt"},
+ {2029, "IBM038"},
+ {2029, "EBCDIC-INT"},
+ {2029, "cp038"},
+ {2029, "csIBM038"},
+ {2030, "IBM273"},
+ {2030, "CP273"},
+ {2030, "csIBM273"},
+ {2031, "IBM274"},
+ {2031, "CP274"},
+ {2031, "EBCDIC-BE"},
+ {2031, "csIBM274"},
+ {2032, "IBM275"},
+ {2032, "EBCDIC-BR"},
+ {2032, "cp275"},
+ {2032, "csIBM275"},
+ {2033, "IBM277"},
+ {2033, "EBCDIC-CP-DK"},
+ {2033, "EBCDIC-CP-NO"},
+ {2033, "csIBM277"},
+ {2034, "IBM278"},
+ {2034, "CP278"},
+ {2034, "csIBM278"},
+ {2034, "ebcdic-cp-fi"},
+ {2034, "ebcdic-cp-se"},
+ {2035, "IBM280"},
+ {2035, "CP280"},
+ {2035, "csIBM280"},
+ {2035, "ebcdic-cp-it"},
+ {2036, "IBM281"},
+ {2036, "EBCDIC-JP-E"},
+ {2036, "cp281"},
+ {2036, "csIBM281"},
+ {2037, "IBM284"},
+ {2037, "CP284"},
+ {2037, "csIBM284"},
+ {2037, "ebcdic-cp-es"},
+ {2038, "IBM285"},
+ {2038, "CP285"},
+ {2038, "csIBM285"},
+ {2038, "ebcdic-cp-gb"},
+ {2039, "IBM290"},
+ {2039, "EBCDIC-JP-kana"},
+ {2039, "cp290"},
+ {2039, "csIBM290"},
+ {2040, "IBM297"},
+ {2040, "cp297"},
+ {2040, "csIBM297"},
+ {2040, "ebcdic-cp-fr"},
+ {2041, "IBM420"},
+ {2041, "cp420"},
+ {2041, "csIBM420"},
+ {2041, "ebcdic-cp-ar1"},
+ {2042, "IBM423"},
+ {2042, "cp423"},
+ {2042, "csIBM423"},
+ {2042, "ebcdic-cp-gr"},
+ {2043, "IBM424"},
+ {2043, "cp424"},
+ {2043, "csIBM424"},
+ {2043, "ebcdic-cp-he"},
+ {2044, "IBM500"},
+ {2044, "CP500"},
+ {2044, "csIBM500"},
+ {2044, "ebcdic-cp-be"},
+ {2044, "ebcdic-cp-ch"},
+ {2045, "IBM851"},
+ {2045, "851"},
+ {2045, "cp851"},
+ {2045, "csIBM851"},
+ {2046, "IBM855"},
+ {2046, "855"},
+ {2046, "cp855"},
+ {2046, "csIBM855"},
+ {2047, "IBM857"},
+ {2047, "857"},
+ {2047, "cp857"},
+ {2047, "csIBM857"},
+ {2048, "IBM860"},
+ {2048, "860"},
+ {2048, "cp860"},
+ {2048, "csIBM860"},
+ {2049, "IBM861"},
+ {2049, "861"},
+ {2049, "cp-is"},
+ {2049, "cp861"},
+ {2049, "csIBM861"},
+ {2050, "IBM863"},
+ {2050, "863"},
+ {2050, "cp863"},
+ {2050, "csIBM863"},
+ {2051, "IBM864"},
+ {2051, "cp864"},
+ {2051, "csIBM864"},
+ {2052, "IBM865"},
+ {2052, "865"},
+ {2052, "cp865"},
+ {2052, "csIBM865"},
+ {2053, "IBM868"},
+ {2053, "CP868"},
+ {2053, "cp-ar"},
+ {2053, "csIBM868"},
+ {2054, "IBM869"},
+ {2054, "869"},
+ {2054, "cp-gr"},
+ {2054, "cp869"},
+ {2054, "csIBM869"},
+ {2055, "IBM870"},
+ {2055, "CP870"},
+ {2055, "csIBM870"},
+ {2055, "ebcdic-cp-roece"},
+ {2055, "ebcdic-cp-yu"},
+ {2056, "IBM871"},
+ {2056, "CP871"},
+ {2056, "csIBM871"},
+ {2056, "ebcdic-cp-is"},
+ {2057, "IBM880"},
+ {2057, "EBCDIC-Cyrillic"},
+ {2057, "cp880"},
+ {2057, "csIBM880"},
+ {2058, "IBM891"},
+ {2058, "cp891"},
+ {2058, "csIBM891"},
+ {2059, "IBM903"},
+ {2059, "cp903"},
+ {2059, "csIBM903"},
+ {2060, "IBM904"},
+ {2060, "904"},
+ {2060, "cp904"},
+ {2060, "csIBBM904"},
+ {2061, "IBM905"},
+ {2061, "CP905"},
+ {2061, "csIBM905"},
+ {2061, "ebcdic-cp-tr"},
+ {2062, "IBM918"},
+ {2062, "CP918"},
+ {2062, "csIBM918"},
+ {2062, "ebcdic-cp-ar2"},
+ {2063, "IBM1026"},
+ {2063, "CP1026"},
+ {2063, "csIBM1026"},
+ {2064, "EBCDIC-AT-DE"},
+ {2064, "csIBMEBCDICATDE"},
+ {2065, "EBCDIC-AT-DE-A"},
+ {2065, "csEBCDICATDEA"},
+ {2066, "EBCDIC-CA-FR"},
+ {2066, "csEBCDICCAFR"},
+ {2067, "EBCDIC-DK-NO"},
+ {2067, "csEBCDICDKNO"},
+ {2068, "EBCDIC-DK-NO-A"},
+ {2068, "csEBCDICDKNOA"},
+ {2069, "EBCDIC-FI-SE"},
+ {2069, "csEBCDICFISE"},
+ {2070, "EBCDIC-FI-SE-A"},
+ {2070, "csEBCDICFISEA"},
+ {2071, "EBCDIC-FR"},
+ {2071, "csEBCDICFR"},
+ {2072, "EBCDIC-IT"},
+ {2072, "csEBCDICIT"},
+ {2073, "EBCDIC-PT"},
+ {2073, "csEBCDICPT"},
+ {2074, "EBCDIC-ES"},
+ {2074, "csEBCDICES"},
+ {2075, "EBCDIC-ES-A"},
+ {2075, "csEBCDICESA"},
+ {2076, "EBCDIC-ES-S"},
+ {2076, "csEBCDICESS"},
+ {2077, "EBCDIC-UK"},
+ {2077, "csEBCDICUK"},
+ {2078, "EBCDIC-US"},
+ {2078, "csEBCDICUS"},
+ {2079, "UNKNOWN-8BIT"},
+ {2079, "csUnknown8BiT"},
+ {2080, "MNEMONIC"},
+ {2080, "csMnemonic"},
+ {2081, "MNEM"},
+ {2081, "csMnem"},
+ {2082, "VISCII"},
+ {2082, "csVISCII"},
+ {2083, "VIQR"},
+ {2083, "csVIQR"},
+ {2084, "KOI8-R"},
+ {2084, "csKOI8R"},
+ {2085, "HZ-GB-2312"},
+ {2086, "IBM866"},
+ {2086, "866"},
+ {2086, "cp866"},
+ {2086, "csIBM866"},
+ {2087, "IBM775"},
+ {2087, "cp775"},
+ {2087, "csPC775Baltic"},
+ {2088, "KOI8-U"},
+ {2088, "csKOI8U"},
+ {2089, "IBM00858"},
+ {2089, "CCSID00858"},
+ {2089, "CP00858"},
+ {2089, "PC-Multilingual-850+euro"},
+ {2089, "csIBM00858"},
+ {2090, "IBM00924"},
+ {2090, "CCSID00924"},
+ {2090, "CP00924"},
+ {2090, "csIBM00924"},
+ {2090, "ebcdic-Latin9--euro"},
+ {2091, "IBM01140"},
+ {2091, "CCSID01140"},
+ {2091, "CP01140"},
+ {2091, "csIBM01140"},
+ {2091, "ebcdic-us-37+euro"},
+ {2092, "IBM01141"},
+ {2092, "CCSID01141"},
+ {2092, "CP01141"},
+ {2092, "csIBM01141"},
+ {2092, "ebcdic-de-273+euro"},
+ {2093, "IBM01142"},
+ {2093, "CCSID01142"},
+ {2093, "CP01142"},
+ {2093, "csIBM01142"},
+ {2093, "ebcdic-dk-277+euro"},
+ {2093, "ebcdic-no-277+euro"},
+ {2094, "IBM01143"},
+ {2094, "CCSID01143"},
+ {2094, "CP01143"},
+ {2094, "csIBM01143"},
+ {2094, "ebcdic-fi-278+euro"},
+ {2094, "ebcdic-se-278+euro"},
+ {2095, "IBM01144"},
+ {2095, "CCSID01144"},
+ {2095, "CP01144"},
+ {2095, "csIBM01144"},
+ {2095, "ebcdic-it-280+euro"},
+ {2096, "IBM01145"},
+ {2096, "CCSID01145"},
+ {2096, "CP01145"},
+ {2096, "csIBM01145"},
+ {2096, "ebcdic-es-284+euro"},
+ {2097, "IBM01146"},
+ {2097, "CCSID01146"},
+ {2097, "CP01146"},
+ {2097, "csIBM01146"},
+ {2097, "ebcdic-gb-285+euro"},
+ {2098, "IBM01147"},
+ {2098, "CCSID01147"},
+ {2098, "CP01147"},
+ {2098, "csIBM01147"},
+ {2098, "ebcdic-fr-297+euro"},
+ {2099, "IBM01148"},
+ {2099, "CCSID01148"},
+ {2099, "CP01148"},
+ {2099, "csIBM01148"},
+ {2099, "ebcdic-international-500+euro"},
+ {2100, "IBM01149"},
+ {2100, "CCSID01149"},
+ {2100, "CP01149"},
+ {2100, "csIBM01149"},
+ {2100, "ebcdic-is-871+euro"},
+ {2101, "Big5-HKSCS"},
+ {2101, "csBig5HKSCS"},
+ {2102, "IBM1047"},
+ {2102, "IBM-1047"},
+ {2102, "csIBM1047"},
+ {2103, "PTCP154"},
+ {2103, "CP154"},
+ {2103, "Cyrillic-Asian"},
+ {2103, "PT154"},
+ {2103, "csPTCP154"},
+ {2104, "Amiga-1251"},
+ {2104, "Ami-1251"},
+ {2104, "Ami1251"},
+ {2104, "Amiga1251"},
+ {2104, "csAmiga1251"},
+ {2105, "KOI7-switched"},
+ {2105, "csKOI7switched"},
+ {2106, "BRF"},
+ {2106, "csBRF"},
+ {2107, "TSCII"},
+ {2107, "csTSCII"},
+ {2108, "CP51932"},
+ {2108, "csCP51932"},
+ {2109, "windows-874"},
+ {2109, "cswindows874"},
+ {2250, "windows-1250"},
+ {2250, "cswindows1250"},
+ {2251, "windows-1251"},
+ {2251, "cswindows1251"},
+ {2252, "windows-1252"},
+ {2252, "cswindows1252"},
+ {2253, "windows-1253"},
+ {2253, "cswindows1253"},
+ {2254, "windows-1254"},
+ {2254, "cswindows1254"},
+ {2255, "windows-1255"},
+ {2255, "cswindows1255"},
+ {2256, "windows-1256"},
+ {2256, "cswindows1256"},
+ {2257, "windows-1257"},
+ {2257, "cswindows1257"},
+ {2258, "windows-1258"},
+ {2258, "cswindows1258"},
+ {2259, "TIS-620"},
+ {2259, "ISO-8859-11"},
+ {2259, "csTIS620"},
+ {2260, "CP50220"},
+ {2260, "csCP50220"},
+ {0, nullptr} // sentinel
+ };
+
+ const __encoding_data* __encoding_rep_ = __text_encoding_data + 1;
+ char __name_[max_name_length + 1] = {0};
+};
+
+template <>
+struct hash<text_encoding> {
+ size_t operator()(const text_encoding& __enc) const noexcept { return std::hash<text_encoding::id>()(__enc.mib()); }
+};
+
+namespace ranges {
+
+template <>
+inline constexpr bool enable_borrowed_range<text_encoding::aliases_view> = true;
+
+} // namespace ranges
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER >= 26
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP_HAS_LOCALIZATION
+
+#endif // _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_H
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index 45b9c72a05b82..bbb915d6e982c 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -2080,6 +2080,13 @@ module std [system] {
export *
}
+ module text_encoding {
+ module text_encoding { header "__text_encoding/text_encoding.h" }
+
+ header "text_encoding"
+ export *
+ }
+
module thread {
module formatter { header "__thread/formatter.h" }
module id { header "__thread/id.h" }
diff --git a/libcxx/include/text_encoding b/libcxx/include/text_encoding
new file mode 100644
index 0000000000000..579608e4f939d
--- /dev/null
+++ b/libcxx/include/text_encoding
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_TEXT_ENCODING
+#define _LIBCPP_TEXT_ENCODING
+
+/* text_encoding synopsis
+namespace std {
+
+struct text_encoding;
+
+// [text.encoding.hash], hash support
+template<class T> struct hash;
+template<> struct hash<text_encoding>;
+
+struct text_encoding
+{
+ static constexpr size_t max_name_length = 63;
+
+ // [text.encoding.id], enumeration text_encoding::id
+ enum 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_view
+ struct 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
+};
+}
+
+*/
+
+#include <__config>
+
+#if _LIBCPP_STD_VER >= 26
+# include <__text_encoding/text_encoding.h>
+#endif // _LIBCPP_STD_VER >= 26
+
+#include <version>
+
+#endif // _LIBCPP_TEXT_ENCODING
diff --git a/libcxx/include/version b/libcxx/include/version
index d98049bd57046..35fe22cb67c26 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -602,7 +602,7 @@ __cpp_lib_void_t 201411L <type_traits>
# undef __cpp_lib_string_view
# define __cpp_lib_string_view 202403L
// # define __cpp_lib_submdspan 202306L
-// # define __cpp_lib_text_encoding 202306L
+# define __cpp_lib_text_encoding 202306L
# undef __cpp_lib_to_chars
// # define __cpp_lib_to_chars 202306L
// # define __cpp_lib_to_string 202306L
diff --git a/libcxx/modules/std.compat.cppm.in b/libcxx/modules/std.compat.cppm.in
index dd7385bf33a42..ab08125c4c4e4 100644
--- a/libcxx/modules/std.compat.cppm.in
+++ b/libcxx/modules/std.compat.cppm.in
@@ -75,9 +75,6 @@ module;
# if __has_include(<stdfloat>)
# error "please update the header information for <stdfloat> in headers_not_available in utils/libcxx/header_information.py"
# endif // __has_include(<stdfloat>)
-# if __has_include(<text_encoding>)
-# error "please update the header information for <text_encoding> in headers_not_available in utils/libcxx/header_information.py"
-# endif // __has_include(<text_encoding>)
#endif // _WIN32
export module std.compat;
diff --git a/libcxx/modules/std.cppm.in b/libcxx/modules/std.cppm.in
index 984b18321923c..32abeca7e0236 100644
--- a/libcxx/modules/std.cppm.in
+++ b/libcxx/modules/std.cppm.in
@@ -110,6 +110,9 @@ module;
#include <strstream>
#include <syncstream>
#include <system_error>
+#if _LIBCPP_HAS_LOCALIZATION
+# include <text_encoding>
+#endif
#include <thread>
#include <tuple>
#include <type_traits>
@@ -159,9 +162,6 @@ module;
# if __has_include(<stdfloat>)
# error "please update the header information for <stdfloat> in headers_not_available in utils/libcxx/header_information.py"
# endif // __has_include(<stdfloat>)
-# if __has_include(<text_encoding>)
-# error "please update the header information for <text_encoding> in headers_not_available in utils/libcxx/header_information.py"
-# endif // __has_include(<text_encoding>)
#endif // _WIN32
export module std;
diff --git a/libcxx/modules/std/text_encoding.inc b/libcxx/modules/std/text_encoding.inc
index 6d5e3f1d68c60..23dd71965414c 100644
--- a/libcxx/modules/std/text_encoding.inc
+++ b/libcxx/modules/std/text_encoding.inc
@@ -8,12 +8,9 @@
//===----------------------------------------------------------------------===//
export namespace std {
-#if 0
-# if _LIBCPP_STD_VER >= 23
+#if _LIBCPP_STD_VER >= 26
+ using ::std::hash;
using std::text_encoding;
-
- // hash support
- using std::hash;
-# endif // _LIBCPP_STD_VER >= 23
+ using ::std::ranges::enable_borrowed_range;
#endif
} // namespace std
diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt
index 97fe57a5f24f8..5923f33883d97 100644
--- a/libcxx/src/CMakeLists.txt
+++ b/libcxx/src/CMakeLists.txt
@@ -92,6 +92,7 @@ if (LIBCXX_ENABLE_LOCALIZATION)
ostream.cpp
regex.cpp
strstream.cpp
+ text_encoding.cpp
)
endif()
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index da735865c322c..84349ea787081 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -553,6 +553,19 @@ locale::locale(const locale& other, const locale& one, category c)
string locale::name() const { return __locale_->name(); }
+# if _LIBCPP_STD_VER >= 26 && __CHAR_BIT__ == 8
+ text_encoding locale::encoding() const {
+ std::string __name = this->name();
+ if(__name.size() == 1){
+ if(__name[0] == 'C')
+ return std::text_encoding(text_encoding::id::ASCII);
+ if(__name[0] == '*')
+ return std::text_encoding();
+ }
+ return std::text_encoding(__name);
+ }
+# endif // _LIBCPP_STD_VER >= 26
+
void locale::__install_ctor(const locale& other, facet* f, long facet_id) {
if (f)
__locale_ = new __imp(*other.__locale_, f, facet_id);
diff --git a/libcxx/src/text_encoding.cpp b/libcxx/src/text_encoding.cpp
new file mode 100644
index 0000000000000..42812aaed49c7
--- /dev/null
+++ b/libcxx/src/text_encoding.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#include <__locale_dir/locale_base_api.h>
+
+#include <text_encoding>
+
+#if __has_include(<langinfo.h>)
+# include <langinfo.h>
+#endif
+
+#if _LIBCPP_STD_VER >= 26
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+#if __CHAR_BIT__ == 8
+
+text_encoding text_encoding::environment() {
+ auto __make_locale = [](const char* __name) {
+ text_encoding __enc{};
+ if (auto __loc = __locale::__newlocale(LC_CTYPE_MASK, __name, static_cast<locale_t>(0))) {
+ if (const char* __codeset = nl_langinfo_l(CODESET, __loc)) {
+ string_view __s(__codeset);
+ if (__s.size() < max_name_length)
+ __enc = text_encoding(__s);
+ }
+ __locale::__freelocale(__loc);
+ }
+ return __enc;
+ };
+
+ return __make_locale("");
+ }
+
+# endif // __CHAR_BIT__ == 8
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 26
diff --git a/libcxx/test/libcxx/transitive_includes/cxx26.csv b/libcxx/test/libcxx/transitive_includes/cxx26.csv
index 5f906338f4b7c..9f5d81d8fc7ca 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx26.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx26.csv
@@ -1048,6 +1048,21 @@ system_error string
system_error string_view
system_error tuple
system_error version
+text_encoding cctype
+text_encoding clocale
+text_encoding compare
+text_encoding cstdint
+text_encoding cstdio
+text_encoding cstdlib
+text_encoding cstring
+text_encoding cwchar
+text_encoding cwctype
+text_encoding initializer_list
+text_encoding iosfwd
+text_encoding limits
+text_encoding stdexcept
+text_encoding string_view
+text_encoding version
thread array
thread atomic
thread bitset
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/text_encoding.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/text_encoding.version.compile.pass.cpp
new file mode 100644
index 0000000000000..817b0f0d655db
--- /dev/null
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/text_encoding.version.compile.pass.cpp
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// WARNING: This test was generated by generate_feature_test_macro_components.py
+// and should not be edited manually.
+
+// <text_encoding>
+
+// Test the feature test macros defined by <text_encoding>
+
+// clang-format off
+
+#include <text_encoding>
+#include "test_macros.h"
+
+#if TEST_STD_VER < 14
+
+# ifdef __cpp_lib_text_encoding
+# error "__cpp_lib_text_encoding should not be defined before c++26"
+# endif
+
+#elif TEST_STD_VER == 14
+
+# ifdef __cpp_lib_text_encoding
+# error "__cpp_lib_text_encoding should not be defined before c++26"
+# endif
+
+#elif TEST_STD_VER == 17
+
+# ifdef __cpp_lib_text_encoding
+# error "__cpp_lib_text_encoding should not be defined before c++26"
+# endif
+
+#elif TEST_STD_VER == 20
+
+# ifdef __cpp_lib_text_encoding
+# error "__cpp_lib_text_encoding should not be defined before c++26"
+# endif
+
+#elif TEST_STD_VER == 23
+
+# ifdef __cpp_lib_text_encoding
+# error "__cpp_lib_text_encoding should not be defined before c++26"
+# endif
+
+#elif TEST_STD_VER > 23
+
+# ifndef __cpp_lib_text_encoding
+# error "__cpp_lib_text_encoding should be defined in c++26"
+# endif
+# if __cpp_lib_text_encoding != 202306L
+# error "__cpp_lib_text_encoding should have the value 202306L in c++26"
+# endif
+
+#endif // TEST_STD_VER > 23
+
+// clang-format on
+
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
index 222d562a19d63..e09a1f6ae88a5 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
@@ -7987,17 +7987,11 @@
# endif
# endif
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_text_encoding
-# error "__cpp_lib_text_encoding should be defined in c++26"
-# endif
-# if __cpp_lib_text_encoding != 202306L
-# error "__cpp_lib_text_encoding should have the value 202306L in c++26"
-# endif
-# else
-# ifdef __cpp_lib_text_encoding
-# error "__cpp_lib_text_encoding should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_text_encoding
+# error "__cpp_lib_text_encoding should be defined in c++26"
+# endif
+# if __cpp_lib_text_encoding != 202306L
+# error "__cpp_lib_text_encoding should have the value 202306L in c++26"
# endif
# ifndef __cpp_lib_three_way_comparison
diff --git a/libcxx/test/std/localization/locales/locale/locale.members/encoding.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.members/encoding.pass.cpp
new file mode 100644
index 0000000000000..7ebfb5a0b4f74
--- /dev/null
+++ b/libcxx/test/std/localization/locales/locale/locale.members/encoding.pass.cpp
@@ -0,0 +1,56 @@
+
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// libc++ not built with C++26 yet
+// XFAIL: *
+// REQUIRES: std-at-least-c++26
+// REQUIRES: locale.en_US.UTF-8
+// UNSUPPORTED: no-localization
+
+// class locale
+
+// text_encoding encoding() const
+
+// Concerns:
+// 1. Default locale returns a text_encoding representing "ASCII"
+// 2. Locale built with en_US.UTF-8 returns text_encoding representing "UTF-8"
+
+#include <cassert>
+#include <locale>
+#include <text_encoding>
+
+#include "test_macros.h"
+#include "platform_support.h"
+
+using id = std::text_encoding::id;
+
+int main() {
+
+ {
+ std::locale loc;
+
+ auto te = loc.encoding();
+ auto classicTE = std::text_encoding(id::ASCII);
+ assert(te == id::ASCII);
+ assert(te == classicTE);
+ }
+
+ {
+ std::locale utf8Locale(LOCALE_en_US_UTF_8);
+
+ auto te = utf8Locale.encoding();
+ auto utf8TE = std::text_encoding(id::UTF8);
+ assert(te == id::UTF8);
+ assert(te == utf8TE);
+ }
+
+ return 0;
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp
new file mode 100644
index 0000000000000..62c30d7295491
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding::text_encoding() noexcept
+
+// Concerns:
+// 1. Default constructor must be nothrow
+// 2. Default constructing a text_encoding object makes it so that mib() == id::unknown, and its name is empty
+
+#include <cassert>
+#include <cstring>
+#include <text_encoding>
+#include <type_traits>
+
+int main(int, char**) {
+ {
+ static_assert(
+ std::is_nothrow_default_constructible<std::text_encoding>::value, "Must be nothrow default constructible");
+ }
+
+ {
+ auto te = std::text_encoding();
+ assert(te.mib() == std::text_encoding::id::unknown);
+ assert(strcmp(te.name(), "") == 0);
+ }
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp
new file mode 100644
index 0000000000000..6562971c73dbb
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp
@@ -0,0 +1,56 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding::text_encoding(id) noexcept
+
+// Concerns:
+// 1. text_encoding(id) must be nothrow
+// 2. Constructing an object with a valid id must set mib() and the name to the corresponding value.
+// 3. Constructing an object using id::unknown must set mib() to id::unknown and the name to an empty string.
+// 4. Constructing an object using id::other must set mib() to id::other and the name to an empty string.
+
+#include "test_text_encoding.h"
+#include <cassert>
+#include <string_view>
+#include <text_encoding>
+#include <type_traits>
+
+using te_id = std::text_encoding::id;
+
+constexpr void test_ctor(te_id i, te_id expect_id, std::string_view expect_name) {
+ auto te = std::text_encoding(i);
+ assert(te.mib() == expect_id);
+ assert(expect_name.compare(te.name()) == 0);
+}
+
+int main() {
+ {
+ static_assert(std::is_nothrow_constructible<std::text_encoding, std::text_encoding::id>::value,
+ "Must be nothrow constructible with id");
+ }
+
+ {
+ for (auto pair : unique_encoding_data){
+ test_ctor(te_id{pair.mib}, te_id{pair.mib}, pair.name);
+ }
+ }
+
+ {
+ for(int i = 2261; i < 2300; i++){ // test out of range id values
+ test_ctor(te_id{i}, te_id::unknown, "");
+ }
+ }
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp
new file mode 100644
index 0000000000000..b72adf0274cb2
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp
@@ -0,0 +1,73 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding::text_encoding(string_view) noexcept
+
+#include "test_macros.h"
+#include "test_text_encoding.h"
+#include <cassert>
+#include <cstring>
+#include <string_view>
+#include <text_encoding>
+#include <type_traits>
+
+constexpr void test_ctor(std::string_view str, std::string_view expect, std::text_encoding::id expect_id) {
+ auto te = std::text_encoding(str);
+ assert(te.mib() == expect_id);
+ assert(expect.compare(te.name()) == 0);
+}
+
+void test_correct_encoding_spellings() {
+ for (auto pair : unique_encoding_data) {
+ test_ctor(pair.name, pair.name, std::text_encoding::id{pair.mib});
+ }
+}
+
+int main() {
+ {
+ static_assert(std::is_nothrow_constructible<std::text_encoding, std::string_view>::value,
+ "Must be nothrow constructible with string_view");
+ }
+
+ // happy paths
+ {
+ test_correct_encoding_spellings();
+ }
+
+ {
+ test_ctor("U_T_F-8", "U_T_F-8", std::text_encoding::UTF8);
+ }
+
+ {
+ test_ctor("utf8", "utf8", std::text_encoding::UTF8);
+ }
+
+ {
+ test_ctor("u.t.f-008", "u.t.f-008", std::text_encoding::UTF8);
+ }
+
+ {
+ test_ctor("utf-80", "utf-80", std::text_encoding::other);
+ }
+
+ {
+ test_ctor("iso885931988", "iso885931988", std::text_encoding::ISOLatin3);
+ }
+
+ {
+ test_ctor("iso00885931988", "iso00885931988", std::text_encoding::ISOLatin3);
+ }
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp
new file mode 100644
index 0000000000000..30ce1badec1d7
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp
@@ -0,0 +1,69 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding operator==(const text_encoding&, id) _NOEXCEPT
+
+// Concerns:
+// 1. operator==(const text_encoding&, id) must be noexcept
+// 2. operator==(const text_encoding&, id) returns true if mib() is equal to the id
+// 3. operator==(const text_encoding&, id) returns false if mib() is not equal to the id
+
+#include <cassert>
+#include <text_encoding>
+#include <type_traits>
+
+#include "test_macros.h"
+#include "test_text_encoding.h"
+
+using id = std::text_encoding::id;
+
+int main() {
+
+ { // 1
+ auto te = std::text_encoding();
+ ASSERT_NOEXCEPT(te == id::UTF8);
+ }
+
+ { // 2
+ auto te = std::text_encoding(id::UTF8);
+ assert(te == id::UTF8);
+ }
+
+ { // 2.0.1
+ constexpr auto te = std::text_encoding();
+ static_assert(te == id::unknown);
+ }
+
+ { // 2.1
+ auto te = std::text_encoding(id::other);
+ assert(te == id::other);
+ }
+
+ { // 2.1.1
+ constexpr auto te = std::text_encoding(id::other);
+ static_assert(te == id::other);
+ }
+
+ { // 3
+ auto te = std::text_encoding(id::UTF8);
+ assert(!(te == id::UTF16));
+ }
+
+ { // 3
+ constexpr auto te = std::text_encoding(id::UTF8);
+ static_assert(!(te == id::UTF16));
+ }
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp
new file mode 100644
index 0000000000000..81fdb0a681143
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding operator==(const text_encoding&, const text_encoding&) _NOEXCEPT
+
+// Concerns:
+// 1. operator==(const text_encoding&, const text_encoding&) must be noexcept
+// 2. operator==(const text_encoding&, const text_encoding&) returns true if both text_encoding ids are equal
+// 3. operator==(const text_encoding&, const text_encoding&) for text_encodings with ids of "other" return true if the names are equal
+// 4. operator==(const text_encoding&, const text_encoding&) returns false when comparingtext_encodings with different ids
+// 5. operator==(const text_encoding&, const text_encoding&) for text_encodings with ids of "other" returns false if the names are not equal
+
+#include <cassert>
+#include <text_encoding>
+#include <type_traits>
+
+#include "test_macros.h"
+#include "test_text_encoding.h"
+
+using id = std::text_encoding::id;
+
+int main(){
+
+ { // 1
+ auto te1 = std::text_encoding();
+ auto te2 = std::text_encoding();
+ ASSERT_NOEXCEPT(te1 == te2);
+ }
+
+ { // 2
+ auto te1 = std::text_encoding(id::UTF8);
+ auto te2 = std::text_encoding(id::UTF8);
+ assert(te1 == te2);
+ }
+
+ { // 3
+ auto other_te1 = std::text_encoding("foo");
+ auto other_te2 = std::text_encoding("foo");
+ assert(other_te1 == other_te2);
+ }
+
+ { // 4
+ auto te1 = std::text_encoding(id::UTF8);
+ auto te2 = std::text_encoding(id::UTF16);
+ assert(!(te1 == te2));
+ }
+
+ { // 5
+ auto other_te1 = std::text_encoding("foo");
+ auto other_te2 = std::text_encoding("bar");
+ assert(!(other_te1 == other_te2));
+ }
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp
new file mode 100644
index 0000000000000..345438d6a1ecb
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding text_encoding::environment();
+
+// Concerns:
+// 1. Verify that text_encoding::aliases_view satisfies ranges::forward_range, copyable, view,
+// ranges::random_access_range and ranges::borrowed_range
+
+#include <concepts>
+#include <ranges>
+#include <text_encoding>
+#include <type_traits>
+
+#include "platform_support.h"
+#include "test_macros.h"
+#include "test_text_encoding.h"
+
+int main(){
+ static_assert(std::ranges::forward_range<std::text_encoding::aliases_view>);
+ static_assert(std::copyable<std::text_encoding::aliases_view>);
+ static_assert(std::ranges::view<std::text_encoding::aliases_view>);
+ static_assert(std::ranges::random_access_range<std::text_encoding::aliases_view>);
+ static_assert(std::ranges::borrowed_range<std::text_encoding::aliases_view>);
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
new file mode 100644
index 0000000000000..c0412d4d39ee1
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+// REQUIRES: locale.en_US.UTF-8
+
+// UNSUPPORTED: no-localization
+// UNSUPPORTED: windows
+
+// libc++ is not built with C++26, and the implementation for this function is in a source file.
+// XFAIL: *
+
+// class text_encoding
+
+// text_encoding text_encoding::environment();
+
+// Concerns:
+// 1. text_encoding::environment() returns the encoding for the "C" locale, which should be the default for any C++ program.
+// 2. text_encoding::environment() still returns the "C" locale encoding when the locale is set to "en_US.UTF-8".
+// 3. text_encoding::environment() is affected by changes to the "LANG" environment variable.
+
+// The current implementation of text_encoding::environment() while conformant,
+// is unfortunately affected by changes to the "LANG" environment variable.
+
+#include <cassert>
+#include <clocale>
+#include <cstdlib>
+#include <string_view>
+#include <text_encoding>
+
+#include "platform_support.h"
+#include "test_macros.h"
+#include "test_text_encoding.h"
+
+int main() {
+
+ { // 1
+ auto te = std::text_encoding::environment();
+
+ assert(te == std::text_encoding::environment());
+ assert(te.mib() == std::text_encoding::id::ASCII);
+ assert(te == std::text_encoding::id::ASCII);
+ assert(std::string_view(te.name()) == "ANSI_X3.4-1968");
+ assert(te == std::text_encoding("ANSI_X3.4-1968"));
+
+ assert(std::text_encoding::environment_is<std::text_encoding::id::ASCII>());
+ }
+
+ { // 2
+ std::setlocale(LC_ALL, "en_US.UTF-8");
+
+ auto te = std::text_encoding::environment();
+
+ assert(te == std::text_encoding::environment());
+ assert(te.mib() == std::text_encoding::id::ASCII);
+ assert(std::string_view(te.name()) == "ANSI_X3.4-1968");
+ assert(te == std::text_encoding("ANSI_X3.4-1968"));
+
+ assert(std::text_encoding::environment_is<std::text_encoding::id::ASCII>());
+ }
+
+ { // 3
+ setenv("LANG", LOCALE_en_US_UTF_8, 1);
+
+ auto te = std::text_encoding::environment();
+
+ assert(te == std::text_encoding::environment());
+ assert(te.mib() == std::text_encoding::id::UTF8);
+ assert(std::string_view(te.name()) == "UTF-8");
+ assert(te == std::text_encoding("UTF-8"));
+
+ assert(std::text_encoding::environment_is<std::text_encoding::id::UTF8>());
+ }
+
+ return 0;
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp
new file mode 100644
index 0000000000000..200f9630de580
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp
@@ -0,0 +1,49 @@
+
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding text_encoding::literal() noexcept;
+
+// Concerns:
+// 1. text_encoding::literal() returns the proper encoding depending on the compiler, else unknown.
+
+#include <cassert>
+#include <text_encoding>
+#include <type_traits>
+#include <string_view>
+
+#include "test_macros.h"
+#include "test_text_encoding.h"
+
+int main() {
+#if __CHAR_BIT__ == 8
+
+ {
+ auto te = std::text_encoding::literal();
+# ifdef __GNUC_EXECUTION_CHARSET_NAME
+ assert(std::string_view(te.name()) == std::string_view(__GNUC_EXECUTION_CHARSET_NAME));
+# elif defined(__clang_literal_encoding__)
+ assert(std::string_view(te.name()) == std::string_view(__clang_literal_encoding__));
+# elif defined(__clang__)
+ assert(std::string_view(te.name()) == "UTF-8");
+ assert(te.mib() == std::text_encoding::id::UTF8);
+# else
+ assert(te.mib() = std::text_encoding::id::unknown);
+# endif
+ }
+
+#endif // if __CHAR_BIT__ == 8
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp
new file mode 100644
index 0000000000000..61c148f854813
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding text_encoding::environment();
+
+// Concerns:
+// 1. begin() of an aliases_view() from a single text_encoding object are the same.
+// 2. begin() of aliases_views of two text_encoding objects that represent the same ID but hold different names are the same.
+// 3. begin() of aliases_views of two text_encoding objects that represent different IDs are different.
+
+#include <cassert>
+#include <cstdlib>
+#include <text_encoding>
+#include <ranges>
+
+#include "platform_support.h"
+#include "test_macros.h"
+#include "test_text_encoding.h"
+
+using id = std::text_encoding::id;
+
+int main() {
+
+ {
+ auto te = std::text_encoding(id::UTF8);
+ auto view1 = te.aliases();
+ auto view2 = te.aliases();
+
+ assert(std::ranges::begin(view1) == std::ranges::begin(view2));
+ }
+
+ {
+ auto te1 = std::text_encoding("ANSI_X3.4-1968");
+ auto te2 = std::text_encoding("ANSI_X3.4-1986");
+
+ auto view1 = te1.aliases();
+ auto view2 = te2.aliases();
+
+ assert(std::ranges::begin(view1) == std::ranges::begin(view2));
+ }
+
+ {
+
+ auto te1 = std::text_encoding(id::UTF8);
+ auto te2 = std::text_encoding(id::ASCII);
+
+ auto view1 = te1.aliases();
+ auto view2 = te2.aliases();
+
+ assert(!(std::ranges::begin(view1) == std::ranges::begin(view2)));
+ }
+
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp
new file mode 100644
index 0000000000000..253a060dc0961
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding text_encoding::environment();
+
+// Concerns:
+// 1. An alias_view of a text_encoding object for "other" is empty
+// 2. An alias_view of a text_encoding object for "unknown" is empty
+// 3. An alias_view of a text_encoding object for a known encoding e.g. "UTF-8" is not empty
+
+#include <cassert>
+#include <cstdlib>
+#include <ranges>
+#include <text_encoding>
+
+#include "platform_support.h"
+#include "test_macros.h"
+#include "test_text_encoding.h"
+
+using id = std::text_encoding::id;
+
+int main(){
+
+ {
+ auto te = std::text_encoding(id::other);
+ auto empty_range = te.aliases();
+
+ assert(std::ranges::empty(empty_range));
+ assert(empty_range.empty());
+ assert(!bool(empty_range));
+ }
+
+ {
+ auto te = std::text_encoding(id::unknown);
+ auto empty_range = te.aliases();
+
+ assert(std::ranges::empty(empty_range));
+ assert(empty_range.empty());
+ assert(!bool(empty_range));
+ }
+
+ {
+ auto te = std::text_encoding(id::UTF8);
+ auto range = te.aliases();
+
+ assert(!std::ranges::empty(range));
+ assert(!range.empty());
+ assert(bool(range));
+ }
+
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp
new file mode 100644
index 0000000000000..fb9f80247b1ac
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding text_encoding::environment();
+
+// Concerns:
+// 1. An aliases_view from a single text_encoding object returns the same front()
+// 2. An aliases_views of two text_encoding objects that represent the same ID but hold different names return the same front()
+// 3. An aliases_views of two text_encoding objects that represent different IDs return different front()
+
+#include <cassert>
+#include <cstdlib>
+#include <text_encoding>
+
+#include "platform_support.h"
+#include "test_macros.h"
+#include "test_text_encoding.h"
+
+using id = std::text_encoding::id;
+
+int main() {
+
+ {
+ auto te = std::text_encoding(id::UTF8);
+
+ auto view1 = te.aliases();
+ auto view2 = te.aliases();
+
+ assert(view1.front() == view2.front());
+ }
+
+ {
+ auto te1 = std::text_encoding("ANSI_X3.4-1968");
+ auto te2 = std::text_encoding("ANSI_X3.4-1986");
+
+ auto view1 = te1.aliases();
+ auto view2 = te2.aliases();
+
+ assert(view1.front() == view2.front());
+ }
+
+ {
+
+ auto te1 = std::text_encoding(id::UTF8);
+ auto te2 = std::text_encoding(id::ASCII);
+
+ auto view1 = te1.aliases();
+ auto view2 = te2.aliases();
+
+ assert(!(view1.front() == view2.front()));
+ }
+
+}
diff --git a/libcxx/test/support/test_text_encoding.h b/libcxx/test/support/test_text_encoding.h
new file mode 100644
index 0000000000000..460a259722f0d
--- /dev/null
+++ b/libcxx/test/support/test_text_encoding.h
@@ -0,0 +1,1173 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SUPPORT_TEST_TEXT_ENCODING_H
+#define SUPPORT_TEST_TEXT_ENCODING_H
+
+#include "test_macros.h"
+#include <cstdint>
+
+struct encoding_pair {
+ int_least32_t mib;
+ const char* name;
+};
+
+constexpr encoding_pair all_encoding_data[] = {
+ {1, ""},
+ {2, ""},
+ {3, "ANSI_X3.4-1968"},
+ {3, "ANSI_X3.4-1986"},
+ {3, "IBM367"},
+ {3, "ISO646-US"},
+ {3, "ISO_646.irv:1991"},
+ {3, "cp367"},
+ {3, "csASCII"},
+ {3, "iso-ir-6"},
+ {3, "us"},
+ {4, "ISO-8859-1"},
+ {4, "ISO_8859-1:1987"},
+ {4, "CP819"},
+ {4, "IBM819"},
+ {4, "ISO_8859-1"},
+ {4, "csISOLatin1"},
+ {4, "iso-ir-100"},
+ {4, "l1"},
+ {4, "latin1"},
+ {5, "ISO-8859-2"},
+ {5, "ISO_8859-2:1987"},
+ {5, "ISO_8859-2"},
+ {5, "csISOLatin2"},
+ {5, "iso-ir-101"},
+ {5, "l2"},
+ {5, "latin2"},
+ {6, "ISO-8859-3"},
+ {6, "ISO_8859-3:1988"},
+ {6, "ISO_8859-3"},
+ {6, "csISOLatin3"},
+ {6, "iso-ir-109"},
+ {6, "l3"},
+ {6, "latin3"},
+ {7, "ISO-8859-4"},
+ {7, "ISO_8859-4:1988"},
+ {7, "ISO_8859-4"},
+ {7, "csISOLatin4"},
+ {7, "iso-ir-110"},
+ {7, "l4"},
+ {7, "latin4"},
+ {8, "ISO-8859-5"},
+ {8, "ISO_8859-5:1988"},
+ {8, "ISO_8859-5"},
+ {8, "csISOLatinCyrillic"},
+ {8, "cyrillic"},
+ {8, "iso-ir-144"},
+ {9, "ISO-8859-6"},
+ {9, "ISO_8859-6:1987"},
+ {9, "ASMO-708"},
+ {9, "ECMA-114"},
+ {9, "ISO_8859-6"},
+ {9, "arabic"},
+ {9, "csISOLatinArabic"},
+ {9, "iso-ir-127"},
+ {10, "ISO-8859-7"},
+ {10, "ISO_8859-7:1987"},
+ {10, "ECMA-118"},
+ {10, "ELOT_928"},
+ {10, "ISO_8859-7"},
+ {10, "csISOLatinGreek"},
+ {10, "greek"},
+ {10, "greek8"},
+ {10, "iso-ir-126"},
+ {11, "ISO-8859-8"},
+ {11, "ISO_8859-8:1988"},
+ {11, "ISO_8859-8"},
+ {11, "csISOLatinHebrew"},
+ {11, "hebrew"},
+ {11, "iso-ir-138"},
+ {12, "ISO-8859-9"},
+ {12, "ISO_8859-9:1989"},
+ {12, "ISO_8859-9"},
+ {12, "csISOLatin5"},
+ {12, "iso-ir-148"},
+ {12, "l5"},
+ {12, "latin5"},
+ {13, "ISO-8859-10"},
+ {13, "ISO_8859-10:1992"},
+ {13, "csISOLatin6"},
+ {13, "iso-ir-157"},
+ {13, "l6"},
+ {13, "latin6"},
+ {14, "ISO_6937-2-add"},
+ {14, "csISOTextComm"},
+ {14, "iso-ir-142"},
+ {15, "JIS_X0201"},
+ {15, "X0201"},
+ {15, "csHalfWidthKatakana"},
+ {16, "JIS_Encoding"},
+ {16, "csJISEncoding"},
+ {17, "Shift_JIS"},
+ {17, "MS_Kanji"},
+ {17, "csShiftJIS"},
+ {18, "EUC-JP"},
+ {18, "Extended_UNIX_Code_Packed_Format_for_Japanese"},
+ {18, "csEUCPkdFmtJapanese"},
+ {19, "Extended_UNIX_Code_Fixed_Width_for_Japanese"},
+ {19, "csEUCFixWidJapanese"},
+ {20, "BS_4730"},
+ {20, "ISO646-GB"},
+ {20, "csISO4UnitedKingdom"},
+ {20, "gb"},
+ {20, "iso-ir-4"},
+ {20, "uk"},
+ {21, "SEN_850200_C"},
+ {21, "ISO646-SE2"},
+ {21, "csISO11SwedishForNames"},
+ {21, "iso-ir-11"},
+ {21, "se2"},
+ {22, "IT"},
+ {22, "ISO646-IT"},
+ {22, "csISO15Italian"},
+ {22, "iso-ir-15"},
+ {23, "ES"},
+ {23, "ISO646-ES"},
+ {23, "csISO17Spanish"},
+ {23, "iso-ir-17"},
+ {24, "DIN_66003"},
+ {24, "ISO646-DE"},
+ {24, "csISO21German"},
+ {24, "de"},
+ {24, "iso-ir-21"},
+ {25, "NS_4551-1"},
+ {25, "ISO646-NO"},
+ {25, "csISO60DanishNorwegian"},
+ {25, "csISO60Norwegian1"},
+ {25, "iso-ir-60"},
+ {25, "no"},
+ {26, "NF_Z_62-010"},
+ {26, "ISO646-FR"},
+ {26, "csISO69French"},
+ {26, "fr"},
+ {26, "iso-ir-69"},
+ {27, "ISO-10646-UTF-1"},
+ {27, "csISO10646UTF1"},
+ {28, "ISO_646.basic:1983"},
+ {28, "csISO646basic1983"},
+ {28, "ref"},
+ {29, "INVARIANT"},
+ {29, "csINVARIANT"},
+ {30, "ISO_646.irv:1983"},
+ {30, "csISO2IntlRefVersion"},
+ {30, "irv"},
+ {30, "iso-ir-2"},
+ {31, "NATS-SEFI"},
+ {31, "csNATSSEFI"},
+ {31, "iso-ir-8-1"},
+ {32, "NATS-SEFI-ADD"},
+ {32, "csNATSSEFIADD"},
+ {32, "iso-ir-8-2"},
+ {33, "NATS-DANO"},
+ {33, "csNATSDANO"},
+ {33, "iso-ir-9-1"},
+ {34, "NATS-DANO-ADD"},
+ {34, "csNATSDANOADD"},
+ {34, "iso-ir-9-2"},
+ {35, "SEN_850200_B"},
+ {35, "FI"},
+ {35, "ISO646-FI"},
+ {35, "ISO646-SE"},
+ {35, "csISO10Swedish"},
+ {35, "iso-ir-10"},
+ {35, "se"},
+ {36, "KS_C_5601-1987"},
+ {36, "KSC_5601"},
+ {36, "KS_C_5601-1989"},
+ {36, "csKSC56011987"},
+ {36, "iso-ir-149"},
+ {36, "korean"},
+ {37, "ISO-2022-KR"},
+ {37, "csISO2022KR"},
+ {38, "EUC-KR"},
+ {38, "csEUCKR"},
+ {39, "ISO-2022-JP"},
+ {39, "csISO2022JP"},
+ {40, "ISO-2022-JP-2"},
+ {40, "csISO2022JP2"},
+ {41, "JIS_C6220-1969-jp"},
+ {41, "JIS_C6220-1969"},
+ {41, "csISO13JISC6220jp"},
+ {41, "iso-ir-13"},
+ {41, "katakana"},
+ {41, "x0201-7"},
+ {42, "JIS_C6220-1969-ro"},
+ {42, "ISO646-JP"},
+ {42, "csISO14JISC6220ro"},
+ {42, "iso-ir-14"},
+ {42, "jp"},
+ {43, "PT"},
+ {43, "ISO646-PT"},
+ {43, "csISO16Portuguese"},
+ {43, "iso-ir-16"},
+ {44, "greek7-old"},
+ {44, "csISO18Greek7Old"},
+ {44, "iso-ir-18"},
+ {45, "latin-greek"},
+ {45, "csISO19LatinGreek"},
+ {45, "iso-ir-19"},
+ {46, "NF_Z_62-010_(1973)"},
+ {46, "ISO646-FR1"},
+ {46, "csISO25French"},
+ {46, "iso-ir-25"},
+ {47, "Latin-greek-1"},
+ {47, "csISO27LatinGreek1"},
+ {47, "iso-ir-27"},
+ {48, "ISO_5427"},
+ {48, "csISO5427Cyrillic"},
+ {48, "iso-ir-37"},
+ {49, "JIS_C6226-1978"},
+ {49, "csISO42JISC62261978"},
+ {49, "iso-ir-42"},
+ {50, "BS_viewdata"},
+ {50, "csISO47BSViewdata"},
+ {50, "iso-ir-47"},
+ {51, "INIS"},
+ {51, "csISO49INIS"},
+ {51, "iso-ir-49"},
+ {52, "INIS-8"},
+ {52, "csISO50INIS8"},
+ {52, "iso-ir-50"},
+ {53, "INIS-cyrillic"},
+ {53, "csISO51INISCyrillic"},
+ {53, "iso-ir-51"},
+ {54, "ISO_5427:1981"},
+ {54, "ISO5427Cyrillic1981"},
+ {54, "csISO54271981"},
+ {54, "iso-ir-54"},
+ {55, "ISO_5428:1980"},
+ {55, "csISO5428Greek"},
+ {55, "iso-ir-55"},
+ {56, "GB_1988-80"},
+ {56, "ISO646-CN"},
+ {56, "cn"},
+ {56, "csISO57GB1988"},
+ {56, "iso-ir-57"},
+ {57, "GB_2312-80"},
+ {57, "chinese"},
+ {57, "csISO58GB231280"},
+ {57, "iso-ir-58"},
+ {58, "NS_4551-2"},
+ {58, "ISO646-NO2"},
+ {58, "csISO61Norwegian2"},
+ {58, "iso-ir-61"},
+ {58, "no2"},
+ {59, "videotex-suppl"},
+ {59, "csISO70VideotexSupp1"},
+ {59, "iso-ir-70"},
+ {60, "PT2"},
+ {60, "ISO646-PT2"},
+ {60, "csISO84Portuguese2"},
+ {60, "iso-ir-84"},
+ {61, "ES2"},
+ {61, "ISO646-ES2"},
+ {61, "csISO85Spanish2"},
+ {61, "iso-ir-85"},
+ {62, "MSZ_7795.3"},
+ {62, "ISO646-HU"},
+ {62, "csISO86Hungarian"},
+ {62, "hu"},
+ {62, "iso-ir-86"},
+ {63, "JIS_C6226-1983"},
+ {63, "JIS_X0208-1983"},
+ {63, "csISO87JISX0208"},
+ {63, "iso-ir-87"},
+ {63, "x0208"},
+ {64, "greek7"},
+ {64, "csISO88Greek7"},
+ {64, "iso-ir-88"},
+ {65, "ASMO_449"},
+ {65, "ISO_9036"},
+ {65, "arabic7"},
+ {65, "csISO89ASMO449"},
+ {65, "iso-ir-89"},
+ {66, "iso-ir-90"},
+ {66, "csISO90"},
+ {67, "JIS_C6229-1984-a"},
+ {67, "csISO91JISC62291984a"},
+ {67, "iso-ir-91"},
+ {67, "jp-ocr-a"},
+ {68, "JIS_C6229-1984-b"},
+ {68, "ISO646-JP-OCR-B"},
+ {68, "csISO92JISC62991984b"},
+ {68, "iso-ir-92"},
+ {68, "jp-ocr-b"},
+ {69, "JIS_C6229-1984-b-add"},
+ {69, "csISO93JIS62291984badd"},
+ {69, "iso-ir-93"},
+ {69, "jp-ocr-b-add"},
+ {70, "JIS_C6229-1984-hand"},
+ {70, "csISO94JIS62291984hand"},
+ {70, "iso-ir-94"},
+ {70, "jp-ocr-hand"},
+ {71, "JIS_C6229-1984-hand-add"},
+ {71, "csISO95JIS62291984handadd"},
+ {71, "iso-ir-95"},
+ {71, "jp-ocr-hand-add"},
+ {72, "JIS_C6229-1984-kana"},
+ {72, "csISO96JISC62291984kana"},
+ {72, "iso-ir-96"},
+ {73, "ISO_2033-1983"},
+ {73, "csISO2033"},
+ {73, "e13b"},
+ {73, "iso-ir-98"},
+ {74, "ANSI_X3.110-1983"},
+ {74, "CSA_T500-1983"},
+ {74, "NAPLPS"},
+ {74, "csISO99NAPLPS"},
+ {74, "iso-ir-99"},
+ {75, "T.61-7bit"},
+ {75, "csISO102T617bit"},
+ {75, "iso-ir-102"},
+ {76, "T.61-8bit"},
+ {76, "T.61"},
+ {76, "csISO103T618bit"},
+ {76, "iso-ir-103"},
+ {77, "ECMA-cyrillic"},
+ {77, "KOI8-E"},
+ {77, "csISO111ECMACyrillic"},
+ {77, "iso-ir-111"},
+ {78, "CSA_Z243.4-1985-1"},
+ {78, "ISO646-CA"},
+ {78, "ca"},
+ {78, "csISO121Canadian1"},
+ {78, "csa7-1"},
+ {78, "csa71"},
+ {78, "iso-ir-121"},
+ {79, "CSA_Z243.4-1985-2"},
+ {79, "ISO646-CA2"},
+ {79, "csISO122Canadian2"},
+ {79, "csa7-2"},
+ {79, "csa72"},
+ {79, "iso-ir-122"},
+ {80, "CSA_Z243.4-1985-gr"},
+ {80, "csISO123CSAZ24341985gr"},
+ {80, "iso-ir-123"},
+ {81, "ISO-8859-6-E"},
+ {81, "ISO_8859-6-E"},
+ {81, "csISO88596E"},
+ {82, "ISO-8859-6-I"},
+ {82, "ISO_8859-6-I"},
+ {82, "csISO88596I"},
+ {83, "T.101-G2"},
+ {83, "csISO128T101G2"},
+ {83, "iso-ir-128"},
+ {84, "ISO-8859-8-E"},
+ {84, "ISO_8859-8-E"},
+ {84, "csISO88598E"},
+ {85, "ISO-8859-8-I"},
+ {85, "ISO_8859-8-I"},
+ {85, "csISO88598I"},
+ {86, "CSN_369103"},
+ {86, "csISO139CSN369103"},
+ {86, "iso-ir-139"},
+ {87, "JUS_I.B1.002"},
+ {87, "ISO646-YU"},
+ {87, "csISO141JUSIB1002"},
+ {87, "iso-ir-141"},
+ {87, "js"},
+ {87, "yu"},
+ {88, "IEC_P27-1"},
+ {88, "csISO143IECP271"},
+ {88, "iso-ir-143"},
+ {89, "JUS_I.B1.003-serb"},
+ {89, "csISO146Serbian"},
+ {89, "iso-ir-146"},
+ {89, "serbian"},
+ {90, "JUS_I.B1.003-mac"},
+ {90, "csISO147Macedonian"},
+ {90, "iso-ir-147"},
+ {90, "macedonian"},
+ {91, "greek-ccitt"},
+ {91, "csISO150"},
+ {91, "csISO150GreekCCITT"},
+ {91, "iso-ir-150"},
+ {92, "NC_NC00-10:81"},
+ {92, "ISO646-CU"},
+ {92, "csISO151Cuba"},
+ {92, "cuba"},
+ {92, "iso-ir-151"},
+ {93, "ISO_6937-2-25"},
+ {93, "csISO6937Add"},
+ {93, "iso-ir-152"},
+ {94, "GOST_19768-74"},
+ {94, "ST_SEV_358-88"},
+ {94, "csISO153GOST1976874"},
+ {94, "iso-ir-153"},
+ {95, "ISO_8859-supp"},
+ {95, "csISO8859Supp"},
+ {95, "iso-ir-154"},
+ {95, "latin1-2-5"},
+ {96, "ISO_10367-box"},
+ {96, "csISO10367Box"},
+ {96, "iso-ir-155"},
+ {97, "latin-lap"},
+ {97, "csISO158Lap"},
+ {97, "iso-ir-158"},
+ {97, "lap"},
+ {98, "JIS_X0212-1990"},
+ {98, "csISO159JISX02121990"},
+ {98, "iso-ir-159"},
+ {98, "x0212"},
+ {99, "DS_2089"},
+ {99, "DS2089"},
+ {99, "ISO646-DK"},
+ {99, "csISO646Danish"},
+ {99, "dk"},
+ {100, "us-dk"},
+ {100, "csUSDK"},
+ {101, "dk-us"},
+ {101, "csDKUS"},
+ {102, "KSC5636"},
+ {102, "ISO646-KR"},
+ {102, "csKSC5636"},
+ {103, "UNICODE-1-1-UTF-7"},
+ {103, "csUnicode11UTF7"},
+ {104, "ISO-2022-CN"},
+ {104, "csISO2022CN"},
+ {105, "ISO-2022-CN-EXT"},
+ {105, "csISO2022CNEXT"},
+ {106, "UTF-8"},
+ {106, "csUTF8"},
+ {109, "ISO-8859-13"},
+ {109, "csISO885913"},
+ {110, "ISO-8859-14"},
+ {110, "ISO_8859-14"},
+ {110, "ISO_8859-14:1998"},
+ {110, "csISO885914"},
+ {110, "iso-celtic"},
+ {110, "iso-ir-199"},
+ {110, "l8"},
+ {110, "latin8"},
+ {111, "ISO-8859-15"},
+ {111, "ISO_8859-15"},
+ {111, "Latin-9"},
+ {111, "csISO885915"},
+ {112, "ISO-8859-16"},
+ {112, "ISO_8859-16"},
+ {112, "ISO_8859-16:2001"},
+ {112, "csISO885916"},
+ {112, "iso-ir-226"},
+ {112, "l10"},
+ {112, "latin10"},
+ {113, "GBK"},
+ {113, "CP936"},
+ {113, "MS936"},
+ {113, "csGBK"},
+ {113, "windows-936"},
+ {114, "GB18030"},
+ {114, "csGB18030"},
+ {115, "OSD_EBCDIC_DF04_15"},
+ {115, "csOSDEBCDICDF0415"},
+ {116, "OSD_EBCDIC_DF03_IRV"},
+ {116, "csOSDEBCDICDF03IRV"},
+ {117, "OSD_EBCDIC_DF04_1"},
+ {117, "csOSDEBCDICDF041"},
+ {118, "ISO-11548-1"},
+ {118, "ISO_11548-1"},
+ {118, "ISO_TR_11548-1"},
+ {118, "csISO115481"},
+ {119, "KZ-1048"},
+ {119, "RK1048"},
+ {119, "STRK1048-2002"},
+ {119, "csKZ1048"},
+ {1000, "ISO-10646-UCS-2"},
+ {1000, "csUnicode"},
+ {1001, "ISO-10646-UCS-4"},
+ {1001, "csUCS4"},
+ {1002, "ISO-10646-UCS-Basic"},
+ {1002, "csUnicodeASCII"},
+ {1003, "ISO-10646-Unicode-Latin1"},
+ {1003, "ISO-10646"},
+ {1003, "csUnicodeLatin1"},
+ {1004, "ISO-10646-J-1"},
+ {1004, "csUnicodeJapanese"},
+ {1005, "ISO-Unicode-IBM-1261"},
+ {1005, "csUnicodeIBM1261"},
+ {1006, "ISO-Unicode-IBM-1268"},
+ {1006, "csUnicodeIBM1268"},
+ {1007, "ISO-Unicode-IBM-1276"},
+ {1007, "csUnicodeIBM1276"},
+ {1008, "ISO-Unicode-IBM-1264"},
+ {1008, "csUnicodeIBM1264"},
+ {1009, "ISO-Unicode-IBM-1265"},
+ {1009, "csUnicodeIBM1265"},
+ {1010, "UNICODE-1-1"},
+ {1010, "csUnicode11"},
+ {1011, "SCSU"},
+ {1011, "csSCSU"},
+ {1012, "UTF-7"},
+ {1012, "csUTF7"},
+ {1013, "UTF-16BE"},
+ {1013, "csUTF16BE"},
+ {1014, "UTF-16LE"},
+ {1014, "csUTF16LE"},
+ {1015, "UTF-16"},
+ {1015, "csUTF16"},
+ {1016, "CESU-8"},
+ {1016, "csCESU-8"},
+ {1016, "csCESU8"},
+ {1017, "UTF-32"},
+ {1017, "csUTF32"},
+ {1018, "UTF-32BE"},
+ {1018, "csUTF32BE"},
+ {1019, "UTF-32LE"},
+ {1019, "csUTF32LE"},
+ {1020, "BOCU-1"},
+ {1020, "csBOCU-1"},
+ {1020, "csBOCU1"},
+ {1021, "UTF-7-IMAP"},
+ {1021, "csUTF7IMAP"},
+ {2000, "ISO-8859-1-Windows-3.0-Latin-1"},
+ {2000, "csWindows30Latin1"},
+ {2001, "ISO-8859-1-Windows-3.1-Latin-1"},
+ {2001, "csWindows31Latin1"},
+ {2002, "ISO-8859-2-Windows-Latin-2"},
+ {2002, "csWindows31Latin2"},
+ {2003, "ISO-8859-9-Windows-Latin-5"},
+ {2003, "csWindows31Latin5"},
+ {2004, "hp-roman8"},
+ {2004, "csHPRoman8"},
+ {2004, "r8"},
+ {2004, "roman8"},
+ {2005, "Adobe-Standard-Encoding"},
+ {2005, "csAdobeStandardEncoding"},
+ {2006, "Ventura-US"},
+ {2006, "csVenturaUS"},
+ {2007, "Ventura-International"},
+ {2007, "csVenturaInternational"},
+ {2008, "DEC-MCS"},
+ {2008, "csDECMCS"},
+ {2008, "dec"},
+ {2009, "IBM850"},
+ {2009, "850"},
+ {2009, "cp850"},
+ {2009, "csPC850Multilingual"},
+ {2010, "IBM852"},
+ {2010, "852"},
+ {2010, "cp852"},
+ {2010, "csPCp852"},
+ {2011, "IBM437"},
+ {2011, "437"},
+ {2011, "cp437"},
+ {2011, "csPC8CodePage437"},
+ {2012, "PC8-Danish-Norwegian"},
+ {2012, "csPC8DanishNorwegian"},
+ {2013, "IBM862"},
+ {2013, "862"},
+ {2013, "cp862"},
+ {2013, "csPC862LatinHebrew"},
+ {2014, "PC8-Turkish"},
+ {2014, "csPC8Turkish"},
+ {2015, "IBM-Symbols"},
+ {2015, "csIBMSymbols"},
+ {2016, "IBM-Thai"},
+ {2016, "csIBMThai"},
+ {2017, "HP-Legal"},
+ {2017, "csHPLegal"},
+ {2018, "HP-Pi-font"},
+ {2018, "csHPPiFont"},
+ {2019, "HP-Math8"},
+ {2019, "csHPMath8"},
+ {2020, "Adobe-Symbol-Encoding"},
+ {2020, "csHPPSMath"},
+ {2021, "HP-DeskTop"},
+ {2021, "csHPDesktop"},
+ {2022, "Ventura-Math"},
+ {2022, "csVenturaMath"},
+ {2023, "Microsoft-Publishing"},
+ {2023, "csMicrosoftPublishing"},
+ {2024, "Windows-31J"},
+ {2024, "csWindows31J"},
+ {2025, "GB2312"},
+ {2025, "csGB2312"},
+ {2026, "Big5"},
+ {2026, "csBig5"},
+ {2027, "macintosh"},
+ {2027, "csMacintosh"},
+ {2027, "mac"},
+ {2028, "IBM037"},
+ {2028, "cp037"},
+ {2028, "csIBM037"},
+ {2028, "ebcdic-cp-ca"},
+ {2028, "ebcdic-cp-nl"},
+ {2028, "ebcdic-cp-us"},
+ {2028, "ebcdic-cp-wt"},
+ {2029, "IBM038"},
+ {2029, "EBCDIC-INT"},
+ {2029, "cp038"},
+ {2029, "csIBM038"},
+ {2030, "IBM273"},
+ {2030, "CP273"},
+ {2030, "csIBM273"},
+ {2031, "IBM274"},
+ {2031, "CP274"},
+ {2031, "EBCDIC-BE"},
+ {2031, "csIBM274"},
+ {2032, "IBM275"},
+ {2032, "EBCDIC-BR"},
+ {2032, "cp275"},
+ {2032, "csIBM275"},
+ {2033, "IBM277"},
+ {2033, "EBCDIC-CP-DK"},
+ {2033, "EBCDIC-CP-NO"},
+ {2033, "csIBM277"},
+ {2034, "IBM278"},
+ {2034, "CP278"},
+ {2034, "csIBM278"},
+ {2034, "ebcdic-cp-fi"},
+ {2034, "ebcdic-cp-se"},
+ {2035, "IBM280"},
+ {2035, "CP280"},
+ {2035, "csIBM280"},
+ {2035, "ebcdic-cp-it"},
+ {2036, "IBM281"},
+ {2036, "EBCDIC-JP-E"},
+ {2036, "cp281"},
+ {2036, "csIBM281"},
+ {2037, "IBM284"},
+ {2037, "CP284"},
+ {2037, "csIBM284"},
+ {2037, "ebcdic-cp-es"},
+ {2038, "IBM285"},
+ {2038, "CP285"},
+ {2038, "csIBM285"},
+ {2038, "ebcdic-cp-gb"},
+ {2039, "IBM290"},
+ {2039, "EBCDIC-JP-kana"},
+ {2039, "cp290"},
+ {2039, "csIBM290"},
+ {2040, "IBM297"},
+ {2040, "cp297"},
+ {2040, "csIBM297"},
+ {2040, "ebcdic-cp-fr"},
+ {2041, "IBM420"},
+ {2041, "cp420"},
+ {2041, "csIBM420"},
+ {2041, "ebcdic-cp-ar1"},
+ {2042, "IBM423"},
+ {2042, "cp423"},
+ {2042, "csIBM423"},
+ {2042, "ebcdic-cp-gr"},
+ {2043, "IBM424"},
+ {2043, "cp424"},
+ {2043, "csIBM424"},
+ {2043, "ebcdic-cp-he"},
+ {2044, "IBM500"},
+ {2044, "CP500"},
+ {2044, "csIBM500"},
+ {2044, "ebcdic-cp-be"},
+ {2044, "ebcdic-cp-ch"},
+ {2045, "IBM851"},
+ {2045, "851"},
+ {2045, "cp851"},
+ {2045, "csIBM851"},
+ {2046, "IBM855"},
+ {2046, "855"},
+ {2046, "cp855"},
+ {2046, "csIBM855"},
+ {2047, "IBM857"},
+ {2047, "857"},
+ {2047, "cp857"},
+ {2047, "csIBM857"},
+ {2048, "IBM860"},
+ {2048, "860"},
+ {2048, "cp860"},
+ {2048, "csIBM860"},
+ {2049, "IBM861"},
+ {2049, "861"},
+ {2049, "cp-is"},
+ {2049, "cp861"},
+ {2049, "csIBM861"},
+ {2050, "IBM863"},
+ {2050, "863"},
+ {2050, "cp863"},
+ {2050, "csIBM863"},
+ {2051, "IBM864"},
+ {2051, "cp864"},
+ {2051, "csIBM864"},
+ {2052, "IBM865"},
+ {2052, "865"},
+ {2052, "cp865"},
+ {2052, "csIBM865"},
+ {2053, "IBM868"},
+ {2053, "CP868"},
+ {2053, "cp-ar"},
+ {2053, "csIBM868"},
+ {2054, "IBM869"},
+ {2054, "869"},
+ {2054, "cp-gr"},
+ {2054, "cp869"},
+ {2054, "csIBM869"},
+ {2055, "IBM870"},
+ {2055, "CP870"},
+ {2055, "csIBM870"},
+ {2055, "ebcdic-cp-roece"},
+ {2055, "ebcdic-cp-yu"},
+ {2056, "IBM871"},
+ {2056, "CP871"},
+ {2056, "csIBM871"},
+ {2056, "ebcdic-cp-is"},
+ {2057, "IBM880"},
+ {2057, "EBCDIC-Cyrillic"},
+ {2057, "cp880"},
+ {2057, "csIBM880"},
+ {2058, "IBM891"},
+ {2058, "cp891"},
+ {2058, "csIBM891"},
+ {2059, "IBM903"},
+ {2059, "cp903"},
+ {2059, "csIBM903"},
+ {2060, "IBM904"},
+ {2060, "904"},
+ {2060, "cp904"},
+ {2060, "csIBBM904"},
+ {2061, "IBM905"},
+ {2061, "CP905"},
+ {2061, "csIBM905"},
+ {2061, "ebcdic-cp-tr"},
+ {2062, "IBM918"},
+ {2062, "CP918"},
+ {2062, "csIBM918"},
+ {2062, "ebcdic-cp-ar2"},
+ {2063, "IBM1026"},
+ {2063, "CP1026"},
+ {2063, "csIBM1026"},
+ {2064, "EBCDIC-AT-DE"},
+ {2064, "csIBMEBCDICATDE"},
+ {2065, "EBCDIC-AT-DE-A"},
+ {2065, "csEBCDICATDEA"},
+ {2066, "EBCDIC-CA-FR"},
+ {2066, "csEBCDICCAFR"},
+ {2067, "EBCDIC-DK-NO"},
+ {2067, "csEBCDICDKNO"},
+ {2068, "EBCDIC-DK-NO-A"},
+ {2068, "csEBCDICDKNOA"},
+ {2069, "EBCDIC-FI-SE"},
+ {2069, "csEBCDICFISE"},
+ {2070, "EBCDIC-FI-SE-A"},
+ {2070, "csEBCDICFISEA"},
+ {2071, "EBCDIC-FR"},
+ {2071, "csEBCDICFR"},
+ {2072, "EBCDIC-IT"},
+ {2072, "csEBCDICIT"},
+ {2073, "EBCDIC-PT"},
+ {2073, "csEBCDICPT"},
+ {2074, "EBCDIC-ES"},
+ {2074, "csEBCDICES"},
+ {2075, "EBCDIC-ES-A"},
+ {2075, "csEBCDICESA"},
+ {2076, "EBCDIC-ES-S"},
+ {2076, "csEBCDICESS"},
+ {2077, "EBCDIC-UK"},
+ {2077, "csEBCDICUK"},
+ {2078, "EBCDIC-US"},
+ {2078, "csEBCDICUS"},
+ {2079, "UNKNOWN-8BIT"},
+ {2079, "csUnknown8BiT"},
+ {2080, "MNEMONIC"},
+ {2080, "csMnemonic"},
+ {2081, "MNEM"},
+ {2081, "csMnem"},
+ {2082, "VISCII"},
+ {2082, "csVISCII"},
+ {2083, "VIQR"},
+ {2083, "csVIQR"},
+ {2084, "KOI8-R"},
+ {2084, "csKOI8R"},
+ {2085, "HZ-GB-2312"},
+ {2086, "IBM866"},
+ {2086, "866"},
+ {2086, "cp866"},
+ {2086, "csIBM866"},
+ {2087, "IBM775"},
+ {2087, "cp775"},
+ {2087, "csPC775Baltic"},
+ {2088, "KOI8-U"},
+ {2088, "csKOI8U"},
+ {2089, "IBM00858"},
+ {2089, "CCSID00858"},
+ {2089, "CP00858"},
+ {2089, "PC-Multilingual-850+euro"},
+ {2089, "csIBM00858"},
+ {2090, "IBM00924"},
+ {2090, "CCSID00924"},
+ {2090, "CP00924"},
+ {2090, "csIBM00924"},
+ {2090, "ebcdic-Latin9--euro"},
+ {2091, "IBM01140"},
+ {2091, "CCSID01140"},
+ {2091, "CP01140"},
+ {2091, "csIBM01140"},
+ {2091, "ebcdic-us-37+euro"},
+ {2092, "IBM01141"},
+ {2092, "CCSID01141"},
+ {2092, "CP01141"},
+ {2092, "csIBM01141"},
+ {2092, "ebcdic-de-273+euro"},
+ {2093, "IBM01142"},
+ {2093, "CCSID01142"},
+ {2093, "CP01142"},
+ {2093, "csIBM01142"},
+ {2093, "ebcdic-dk-277+euro"},
+ {2093, "ebcdic-no-277+euro"},
+ {2094, "IBM01143"},
+ {2094, "CCSID01143"},
+ {2094, "CP01143"},
+ {2094, "csIBM01143"},
+ {2094, "ebcdic-fi-278+euro"},
+ {2094, "ebcdic-se-278+euro"},
+ {2095, "IBM01144"},
+ {2095, "CCSID01144"},
+ {2095, "CP01144"},
+ {2095, "csIBM01144"},
+ {2095, "ebcdic-it-280+euro"},
+ {2096, "IBM01145"},
+ {2096, "CCSID01145"},
+ {2096, "CP01145"},
+ {2096, "csIBM01145"},
+ {2096, "ebcdic-es-284+euro"},
+ {2097, "IBM01146"},
+ {2097, "CCSID01146"},
+ {2097, "CP01146"},
+ {2097, "csIBM01146"},
+ {2097, "ebcdic-gb-285+euro"},
+ {2098, "IBM01147"},
+ {2098, "CCSID01147"},
+ {2098, "CP01147"},
+ {2098, "csIBM01147"},
+ {2098, "ebcdic-fr-297+euro"},
+ {2099, "IBM01148"},
+ {2099, "CCSID01148"},
+ {2099, "CP01148"},
+ {2099, "csIBM01148"},
+ {2099, "ebcdic-international-500+euro"},
+ {2100, "IBM01149"},
+ {2100, "CCSID01149"},
+ {2100, "CP01149"},
+ {2100, "csIBM01149"},
+ {2100, "ebcdic-is-871+euro"},
+ {2101, "Big5-HKSCS"},
+ {2101, "csBig5HKSCS"},
+ {2102, "IBM1047"},
+ {2102, "IBM-1047"},
+ {2102, "csIBM1047"},
+ {2103, "PTCP154"},
+ {2103, "CP154"},
+ {2103, "Cyrillic-Asian"},
+ {2103, "PT154"},
+ {2103, "csPTCP154"},
+ {2104, "Amiga-1251"},
+ {2104, "Ami-1251"},
+ {2104, "Ami1251"},
+ {2104, "Amiga1251"},
+ {2104, "csAmiga1251"},
+ {2105, "KOI7-switched"},
+ {2105, "csKOI7switched"},
+ {2106, "BRF"},
+ {2106, "csBRF"},
+ {2107, "TSCII"},
+ {2107, "csTSCII"},
+ {2108, "CP51932"},
+ {2108, "csCP51932"},
+ {2109, "windows-874"},
+ {2109, "cswindows874"},
+ {2250, "windows-1250"},
+ {2250, "cswindows1250"},
+ {2251, "windows-1251"},
+ {2251, "cswindows1251"},
+ {2252, "windows-1252"},
+ {2252, "cswindows1252"},
+ {2253, "windows-1253"},
+ {2253, "cswindows1253"},
+ {2254, "windows-1254"},
+ {2254, "cswindows1254"},
+ {2255, "windows-1255"},
+ {2255, "cswindows1255"},
+ {2256, "windows-1256"},
+ {2256, "cswindows1256"},
+ {2257, "windows-1257"},
+ {2257, "cswindows1257"},
+ {2258, "windows-1258"},
+ {2258, "cswindows1258"},
+ {2259, "TIS-620"},
+ {2259, "ISO-8859-11"},
+ {2259, "csTIS620"},
+ {2260, "CP50220"},
+ {2260, "csCP50220"},
+ {0, nullptr} // sentinel
+};
+
+constexpr encoding_pair unique_encoding_data[] = {
+ {3, "ANSI_X3.4-1968"},
+ {4, "ISO-8859-1"},
+ {5, "ISO-8859-2"},
+ {6, "ISO-8859-3"},
+ {7, "ISO-8859-4"},
+ {8, "ISO-8859-5"},
+ {9, "ISO-8859-6"},
+ {10, "ISO-8859-7"},
+ {11, "ISO-8859-8"},
+ {12, "ISO-8859-9"},
+ {13, "ISO-8859-10"},
+ {14, "ISO_6937-2-add"},
+ {15, "JIS_X0201"},
+ {16, "JIS_Encoding"},
+ {17, "Shift_JIS"},
+ {18, "EUC-JP"},
+ {19, "Extended_UNIX_Code_Fixed_Width_for_Japanese"},
+ {20, "BS_4730"},
+ {21, "SEN_850200_C"},
+ {22, "IT"},
+ {23, "ES"},
+ {24, "DIN_66003"},
+ {25, "NS_4551-1"},
+ {26, "NF_Z_62-010"},
+ {27, "ISO-10646-UTF-1"},
+ {28, "ISO_646.basic:1983"},
+ {29, "INVARIANT"},
+ {30, "ISO_646.irv:1983"},
+ {31, "NATS-SEFI"},
+ {32, "NATS-SEFI-ADD"},
+ {33, "NATS-DANO"},
+ {34, "NATS-DANO-ADD"},
+ {35, "SEN_850200_B"},
+ {36, "KS_C_5601-1987"},
+ {37, "ISO-2022-KR"},
+ {38, "EUC-KR"},
+ {39, "ISO-2022-JP"},
+ {40, "ISO-2022-JP-2"},
+ {41, "JIS_C6220-1969-jp"},
+ {42, "JIS_C6220-1969-ro"},
+ {43, "PT"},
+ {44, "greek7-old"},
+ {45, "latin-greek"},
+ {46, "NF_Z_62-010_(1973)"},
+ {47, "Latin-greek-1"},
+ {48, "ISO_5427"},
+ {49, "JIS_C6226-1978"},
+ {50, "BS_viewdata"},
+ {51, "INIS"},
+ {52, "INIS-8"},
+ {53, "INIS-cyrillic"},
+ {54, "ISO_5427:1981"},
+ {55, "ISO_5428:1980"},
+ {56, "GB_1988-80"},
+ {57, "GB_2312-80"},
+ {58, "NS_4551-2"},
+ {59, "videotex-suppl"},
+ {60, "PT2"},
+ {61, "ES2"},
+ {62, "MSZ_7795.3"},
+ {63, "JIS_C6226-1983"},
+ {64, "greek7"},
+ {65, "ASMO_449"},
+ {66, "iso-ir-90"},
+ {67, "JIS_C6229-1984-a"},
+ {68, "JIS_C6229-1984-b"},
+ {69, "JIS_C6229-1984-b-add"},
+ {70, "JIS_C6229-1984-hand"},
+ {71, "JIS_C6229-1984-hand-add"},
+ {72, "JIS_C6229-1984-kana"},
+ {73, "ISO_2033-1983"},
+ {74, "ANSI_X3.110-1983"},
+ {75, "T.61-7bit"},
+ {76, "T.61-8bit"},
+ {77, "ECMA-cyrillic"},
+ {78, "CSA_Z243.4-1985-1"},
+ {79, "CSA_Z243.4-1985-2"},
+ {80, "CSA_Z243.4-1985-gr"},
+ {81, "ISO-8859-6-E"},
+ {82, "ISO-8859-6-I"},
+ {83, "T.101-G2"},
+ {84, "ISO-8859-8-E"},
+ {85, "ISO-8859-8-I"},
+ {86, "CSN_369103"},
+ {87, "JUS_I.B1.002"},
+ {88, "IEC_P27-1"},
+ {89, "JUS_I.B1.003-serb"},
+ {90, "JUS_I.B1.003-mac"},
+ {91, "greek-ccitt"},
+ {92, "NC_NC00-10:81"},
+ {93, "ISO_6937-2-25"},
+ {94, "GOST_19768-74"},
+ {95, "ISO_8859-supp"},
+ {96, "ISO_10367-box"},
+ {97, "latin-lap"},
+ {98, "JIS_X0212-1990"},
+ {99, "DS_2089"},
+ {100, "us-dk"},
+ {101, "dk-us"},
+ {102, "KSC5636"},
+ {103, "UNICODE-1-1-UTF-7"},
+ {104, "ISO-2022-CN"},
+ {105, "ISO-2022-CN-EXT"},
+ {106, "UTF-8"},
+ {109, "ISO-8859-13"},
+ {110, "ISO-8859-14"},
+ {111, "ISO-8859-15"},
+ {112, "ISO-8859-16"},
+ {113, "GBK"},
+ {114, "GB18030"},
+ {115, "OSD_EBCDIC_DF04_15"},
+ {116, "OSD_EBCDIC_DF03_IRV"},
+ {117, "OSD_EBCDIC_DF04_1"},
+ {118, "ISO-11548-1"},
+ {119, "KZ-1048"},
+ {1000, "ISO-10646-UCS-2"},
+ {1001, "ISO-10646-UCS-4"},
+ {1002, "ISO-10646-UCS-Basic"},
+ {1003, "ISO-10646-Unicode-Latin1"},
+ {1004, "ISO-10646-J-1"},
+ {1005, "ISO-Unicode-IBM-1261"},
+ {1006, "ISO-Unicode-IBM-1268"},
+ {1007, "ISO-Unicode-IBM-1276"},
+ {1008, "ISO-Unicode-IBM-1264"},
+ {1009, "ISO-Unicode-IBM-1265"},
+ {1010, "UNICODE-1-1"},
+ {1011, "SCSU"},
+ {1012, "UTF-7"},
+ {1013, "UTF-16BE"},
+ {1014, "UTF-16LE"},
+ {1015, "UTF-16"},
+ {1016, "CESU-8"},
+ {1017, "UTF-32"},
+ {1018, "UTF-32BE"},
+ {1019, "UTF-32LE"},
+ {1020, "BOCU-1"},
+ {1021, "UTF-7-IMAP"},
+ {2000, "ISO-8859-1-Windows-3.0-Latin-1"},
+ {2001, "ISO-8859-1-Windows-3.1-Latin-1"},
+ {2002, "ISO-8859-2-Windows-Latin-2"},
+ {2003, "ISO-8859-9-Windows-Latin-5"},
+ {2004, "hp-roman8"},
+ {2005, "Adobe-Standard-Encoding"},
+ {2006, "Ventura-US"},
+ {2007, "Ventura-International"},
+ {2008, "DEC-MCS"},
+ {2009, "IBM850"},
+ {2010, "IBM852"},
+ {2011, "IBM437"},
+ {2012, "PC8-Danish-Norwegian"},
+ {2013, "IBM862"},
+ {2014, "PC8-Turkish"},
+ {2015, "IBM-Symbols"},
+ {2016, "IBM-Thai"},
+ {2017, "HP-Legal"},
+ {2018, "HP-Pi-font"},
+ {2019, "HP-Math8"},
+ {2020, "Adobe-Symbol-Encoding"},
+ {2021, "HP-DeskTop"},
+ {2022, "Ventura-Math"},
+ {2023, "Microsoft-Publishing"},
+ {2024, "Windows-31J"},
+ {2025, "GB2312"},
+ {2026, "Big5"},
+ {2027, "macintosh"},
+ {2028, "IBM037"},
+ {2029, "IBM038"},
+ {2030, "IBM273"},
+ {2031, "IBM274"},
+ {2032, "IBM275"},
+ {2033, "IBM277"},
+ {2034, "IBM278"},
+ {2035, "IBM280"},
+ {2036, "IBM281"},
+ {2037, "IBM284"},
+ {2038, "IBM285"},
+ {2039, "IBM290"},
+ {2040, "IBM297"},
+ {2041, "IBM420"},
+ {2042, "IBM423"},
+ {2043, "IBM424"},
+ {2044, "IBM500"},
+ {2045, "IBM851"},
+ {2046, "IBM855"},
+ {2047, "IBM857"},
+ {2048, "IBM860"},
+ {2049, "IBM861"},
+ {2050, "IBM863"},
+ {2051, "IBM864"},
+ {2052, "IBM865"},
+ {2053, "IBM868"},
+ {2054, "IBM869"},
+ {2055, "IBM870"},
+ {2056, "IBM871"},
+ {2057, "IBM880"},
+ {2058, "IBM891"},
+ {2059, "IBM903"},
+ {2060, "IBM904"},
+ {2061, "IBM905"},
+ {2062, "IBM918"},
+ {2063, "IBM1026"},
+ {2064, "EBCDIC-AT-DE"},
+ {2065, "EBCDIC-AT-DE-A"},
+ {2066, "EBCDIC-CA-FR"},
+ {2067, "EBCDIC-DK-NO"},
+ {2068, "EBCDIC-DK-NO-A"},
+ {2069, "EBCDIC-FI-SE"},
+ {2070, "EBCDIC-FI-SE-A"},
+ {2071, "EBCDIC-FR"},
+ {2072, "EBCDIC-IT"},
+ {2073, "EBCDIC-PT"},
+ {2074, "EBCDIC-ES"},
+ {2075, "EBCDIC-ES-A"},
+ {2076, "EBCDIC-ES-S"},
+ {2077, "EBCDIC-UK"},
+ {2078, "EBCDIC-US"},
+ {2079, "UNKNOWN-8BIT"},
+ {2080, "MNEMONIC"},
+ {2081, "MNEM"},
+ {2082, "VISCII"},
+ {2083, "VIQR"},
+ {2084, "KOI8-R"},
+ {2085, "HZ-GB-2312"},
+ {2086, "IBM866"},
+ {2087, "IBM775"},
+ {2088, "KOI8-U"},
+ {2089, "IBM00858"},
+ {2090, "IBM00924"},
+ {2091, "IBM01140"},
+ {2092, "IBM01141"},
+ {2093, "IBM01142"},
+ {2094, "IBM01143"},
+ {2095, "IBM01144"},
+ {2096, "IBM01145"},
+ {2097, "IBM01146"},
+ {2098, "IBM01147"},
+ {2099, "IBM01148"},
+ {2100, "IBM01149"},
+ {2101, "Big5-HKSCS"},
+ {2102, "IBM1047"},
+ {2103, "PTCP154"},
+ {2104, "Amiga-1251"},
+ {2105, "KOI7-switched"},
+ {2106, "BRF"},
+ {2107, "TSCII"},
+ {2108, "CP51932"},
+ {2109, "windows-874"},
+ {2250, "windows-1250"},
+ {2251, "windows-1251"},
+ {2252, "windows-1252"},
+ {2253, "windows-1253"},
+ {2254, "windows-1254"},
+ {2255, "windows-1255"},
+ {2256, "windows-1256"},
+ {2257, "windows-1257"},
+ {2258, "windows-1258"},
+ {2259, "TIS-620"},
+ {2260, "CP50220"},
+};
+
+#endif // SUPPORT_TEST_TEXT_ENCODING_H
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index 18eb8a8623748..b97925843cc19 100644
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -1373,7 +1373,6 @@ def add_version_header(tc):
"c++26": 202306 # P1885R12 Naming Text Encodings to Demystify Them
},
"headers": ["text_encoding"],
- "unimplemented": True,
},
{
"name": "__cpp_lib_three_way_comparison",
diff --git a/libcxx/utils/libcxx/header_information.py b/libcxx/utils/libcxx/header_information.py
index d06271a7908cc..ad011374a14a4 100644
--- a/libcxx/utils/libcxx/header_information.py
+++ b/libcxx/utils/libcxx/header_information.py
@@ -172,7 +172,6 @@ def __hash__(self) -> int:
"spanstream",
"stacktrace",
"stdfloat",
- "text_encoding",
]))
header_restrictions = {
>From 51245dfb59cebc94c49f4fcac9b2da92ed110bb1 Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Fri, 23 May 2025 22:58:03 -0400
Subject: [PATCH 2/9] Squash commit history
---
libcxx/include/CMakeLists.txt | 1 +
libcxx/include/__locale | 25 +-
libcxx/include/__locale_dir/locale_base_api.h | 9 +
.../__locale_dir/locale_base_api/ibm.h | 10 +
.../include/__locale_dir/support/bsd_like.h | 11 +-
libcxx/include/__locale_dir/support/fuchsia.h | 10 +
libcxx/include/__locale_dir/support/linux.h | 10 +
.../__text_encoding/get_locale_encoding.h | 29 +
.../include/__text_encoding/text_encoding.h | 1954 ++++++++---------
libcxx/include/module.modulemap.in | 3 +-
libcxx/include/text_encoding | 20 +-
...bcxxabi.v1.stable.exceptions.nonew.abilist | 5 +-
...bcxxabi.v1.stable.exceptions.nonew.abilist | 8 +-
libcxx/modules/std.cppm.in | 4 +-
libcxx/modules/std/text_encoding.inc | 6 +-
libcxx/src/locale.cpp | 13 -
libcxx/src/text_encoding.cpp | 50 +-
.../test/libcxx/transitive_includes/cxx26.csv | 2 -
.../get_long_double_fr_FR.pass.cpp | 32 +-
.../put_long_double_fr_FR.pass.cpp | 32 +-
.../locale/locale.members/encoding.pass.cpp | 10 +-
.../text_encoding.ctor/default.pass.cpp | 9 +-
.../text_encoding.ctor/id.pass.cpp | 76 +-
.../text_encoding.ctor/string_view.pass.cpp | 37 +-
.../text_encoding.eq/equal.id.pass.cpp | 4 +-
.../text_encoding.eq/equal.pass.cpp | 6 +-
.../text_encoding.members/aliases.pass.cpp | 10 +-
.../environment.pass.cpp | 62 +-
.../text_encoding.members/literal.pass.cpp | 10 +-
.../nodiscard.verify.cpp | 37 +
.../text_encoding.aliases_view/begin.pass.cpp | 23 +-
.../text_encoding.aliases_view/empty.pass.cpp | 20 +-
.../text_encoding.aliases_view/front.pass.cpp | 21 +-
libcxx/test/support/test_text_encoding.h | 46 +-
34 files changed, 1379 insertions(+), 1226 deletions(-)
create mode 100644 libcxx/include/__text_encoding/get_locale_encoding.h
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.members/nodiscard.verify.cpp
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index a1cb0ecddd3d6..fe4f7bbaa45c3 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -762,6 +762,7 @@ set(files
__system_error/error_condition.h
__system_error/system_error.h
__system_error/throw_system_error.h
+ __text_encoding/get_locale_encoding.h
__text_encoding/text_encoding.h
__thread/formatter.h
__thread/id.h
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index 268fdfdef2e5f..3c38eedbfca6c 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -102,9 +102,28 @@ public:
// locale operations:
string name() const;
-
-# if _LIBCPP_STD_VER >= 26 && __CHAR_BIT__ == 8
- text_encoding encoding() const;
+
+# if _LIBCPP_STD_VER >= 26
+ _LIBCPP_HIDE_FROM_ABI text_encoding encoding() const {
+ std::string __name = this->name();
+ if (__name.size() == 1) {
+ if (__name[0] == 'C')
+ return std::text_encoding(text_encoding::id::ASCII);
+ if (__name[0] == '*')
+ return std::text_encoding();
+ }
+
+ auto __encoding_divider = __name.find('.'), __modifier_at = __name.find('@');
+ if (__encoding_divider == std::string::npos) {
+ return std::text_encoding();
+ }
+
+ if (__modifier_at == std::string::npos) {
+ return std::text_encoding(__name.c_str() + __encoding_divider + 1);
+ }
+
+ return std::text_encoding({__name.c_str() + __encoding_divider + 1, __modifier_at - 1 - __encoding_divider});
+ }
# endif // _LIBCPP_STD_VER >= 26
bool operator==(const locale&) const;
diff --git a/libcxx/include/__locale_dir/locale_base_api.h b/libcxx/include/__locale_dir/locale_base_api.h
index 8dbc28e839839..f9945fac29af3 100644
--- a/libcxx/include/__locale_dir/locale_base_api.h
+++ b/libcxx/include/__locale_dir/locale_base_api.h
@@ -147,6 +147,9 @@
# if _LIBCPP_HAS_WIDE_CHARACTERS
# include <wctype.h>
# endif
+# if __has_include(<langinfo.h>)
+# include <langinfo.h>
+# endif
_LIBCPP_BEGIN_NAMESPACE_STD
namespace __locale {
//
@@ -177,6 +180,12 @@ inline _LIBCPP_HIDE_FROM_ABI char* __setlocale(int __category, char const* __loc
inline _LIBCPP_HIDE_FROM_ABI void __freelocale(__locale_t __loc) { freelocale(__loc); }
inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) { return __libcpp_localeconv_l(__loc); }
+
+# if __has_include(<langinfo.h>)
+inline _LIBCPP_HIDE_FROM_ABI char* __nl_langinfo_l(int __category_mask, __locale_t __l) {
+ return ::nl_langinfo_l(__category_mask, __l);
+}
+# endif
# endif // _LIBCPP_BUILDING_LIBRARY
//
diff --git a/libcxx/include/__locale_dir/locale_base_api/ibm.h b/libcxx/include/__locale_dir/locale_base_api/ibm.h
index 1d1d15df9f799..a8aa519066fdc 100644
--- a/libcxx/include/__locale_dir/locale_base_api/ibm.h
+++ b/libcxx/include/__locale_dir/locale_base_api/ibm.h
@@ -18,6 +18,10 @@
#include <stdarg.h>
#include <stdio.h>
+#if __has_include(<langinfo.h>)
+# include <langinfo.h>
+#endif
+
#include "cstdlib"
#if defined(__MVS__)
@@ -105,4 +109,10 @@ _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 2, 0) int vasprintf(char** strp, const char
return str_size;
}
+#if __has_include(<langinfo.h>)
+inline _LIBCPP_HIDE_FROM_ABI char* __nl_langinfo_l(int __category_mask, __locale_t __l) {
+ return ::nl_langinfo_l(__category_mask, __l);
+}
+#endif
+
#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_IBM_H
diff --git a/libcxx/include/__locale_dir/support/bsd_like.h b/libcxx/include/__locale_dir/support/bsd_like.h
index ac402924709e5..2ad769d44429d 100644
--- a/libcxx/include/__locale_dir/support/bsd_like.h
+++ b/libcxx/include/__locale_dir/support/bsd_like.h
@@ -23,7 +23,9 @@
# include <wchar.h>
# include <wctype.h>
#endif
-
+#if __has_include(<langinfo.h>)
+# include <langinfo.h>
+#endif
#include <xlocale.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -60,6 +62,13 @@ inline _LIBCPP_HIDE_FROM_ABI char* __setlocale(int __category, char const* __loc
}
inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) { return ::localeconv_l(__loc); }
+
+# if __has_include(<langinfo.h>)
+inline _LIBCPP_HIDE_FROM_ABI char* __nl_langinfo_l(int __category_mask, __locale_t __l) {
+ return ::nl_langinfo_l(__category_mask, __l);
+}
+# endif
+
#endif // _LIBCPP_BUILDING_LIBRARY
//
diff --git a/libcxx/include/__locale_dir/support/fuchsia.h b/libcxx/include/__locale_dir/support/fuchsia.h
index 4b9e63facb19e..e987c960987b3 100644
--- a/libcxx/include/__locale_dir/support/fuchsia.h
+++ b/libcxx/include/__locale_dir/support/fuchsia.h
@@ -16,6 +16,10 @@
#include <cstdlib>
#include <cwchar>
+#if __has_include(<langinfo.h>)
+# include <langinfo.h>
+#endif
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
@@ -69,6 +73,12 @@ inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) {
return std::localeconv();
}
+# if __has_include(<langinfo.h>)
+inline _LIBCPP_HIDE_FROM_ABI char* __nl_langinfo_l(int __category_mask, __locale_t __l) {
+ return ::nl_langinfo_l(__category_mask, __l);
+}
+# endif
+
//
// Other functions
//
diff --git a/libcxx/include/__locale_dir/support/linux.h b/libcxx/include/__locale_dir/support/linux.h
index 23bcf44c31dbf..119cb51b9a309 100644
--- a/libcxx/include/__locale_dir/support/linux.h
+++ b/libcxx/include/__locale_dir/support/linux.h
@@ -24,6 +24,9 @@
# include <cwchar>
# include <wctype.h>
#endif
+#if __has_include(<langinfo.h>)
+# include <langinfo.h>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -77,6 +80,13 @@ inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) {
__locale_guard __current(__loc);
return std::localeconv();
}
+
+# if __has_include(<langinfo.h>)
+inline _LIBCPP_HIDE_FROM_ABI char* __nl_langinfo_l(int __category_mask, __locale_t __l) {
+ return ::nl_langinfo_l(__category_mask, __l);
+}
+# endif
+
#endif // _LIBCPP_BUILDING_LIBRARY
//
diff --git a/libcxx/include/__text_encoding/get_locale_encoding.h b/libcxx/include/__text_encoding/get_locale_encoding.h
new file mode 100644
index 0000000000000..9e2a6d7f08d61
--- /dev/null
+++ b/libcxx/include/__text_encoding/get_locale_encoding.h
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___GET_LOCALE_ENCODING_H
+#define _LIBCPP___GET_LOCALE_ENCODING_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+#if _LIBCPP_HAS_LOCALIZATION
+
+# include <string_view>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+string_view _LIBCPP_EXPORTED_FROM_ABI __get_locale_encoding(const char* __name);
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_HAS_LOCALIZATION
+
+#endif // _LIBCPP___GET_LOCALE_ENCODING_H
diff --git a/libcxx/include/__text_encoding/text_encoding.h b/libcxx/include/__text_encoding/text_encoding.h
index 93d0ae2ab6b89..7098549752e39 100644
--- a/libcxx/include/__text_encoding/text_encoding.h
+++ b/libcxx/include/__text_encoding/text_encoding.h
@@ -16,16 +16,17 @@
# pragma GCC system_header
#endif
-#if _LIBCPP_HAS_LOCALIZATION
-
#include <__algorithm/copy_n.h>
+#include <__algorithm/find.h>
#include <__algorithm/lower_bound.h>
#include <__algorithm/min.h>
+#include <__assert>
#include <__functional/hash.h>
#include <__iterator/iterator_traits.h>
-#include <__locale_dir/locale_base_api.h>
+#include <__ranges/enable_borrowed_range.h>
#include <__ranges/view_interface.h>
#include <__string/char_traits.h>
+#include <__text_encoding/get_locale_encoding.h>
#include <__utility/unreachable.h>
#include <cstdint>
#include <string_view>
@@ -36,26 +37,32 @@ _LIBCPP_PUSH_MACROS
#if _LIBCPP_STD_VER >= 26
_LIBCPP_BEGIN_NAMESPACE_STD
-struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
+struct text_encoding {
static constexpr size_t max_name_length = 63;
private:
+ using __id_rep _LIBCPP_NODEBUG = int_least32_t;
struct __encoding_data {
- using __id_rep _LIBCPP_NODEBUG = int_least32_t;
- __id_rep __mib_rep;
- const char* __name;
+ const char* __name_;
+ __id_rep __mib_rep_;
+ uint_least32_t __name_size_;
+
+ friend constexpr bool operator==(const __encoding_data& __e, const __encoding_data& __other) noexcept {
+ return __e.__mib_rep_ == __other.__mib_rep_ ||
+ __comp_name(string_view(__e.__name_, __e.__name_size_), string_view(__other.__name_, __e.__name_size_));
+ }
- friend constexpr bool operator==(const __encoding_data& __e, const __encoding_data& __other) _NOEXCEPT {
- return __e.__mib_rep == __other.__mib_rep || __comp_name(__e.__name, __other.__name);
+ friend constexpr bool operator<(const __encoding_data& __e, const __id_rep __i) noexcept {
+ return __e.__mib_rep_ < __i;
}
- friend constexpr bool operator<(const __encoding_data& __e, const __id_rep __i) _NOEXCEPT {
- return __e.__mib_rep < __i;
+ friend constexpr bool operator==(const __encoding_data& __e, std::string_view __name) noexcept {
+ return __comp_name(__name, string_view(__e.__name_, __e.__name_size_));
}
};
public:
- enum class id : __encoding_data::__id_rep {
+ enum class id : __id_rep {
other = 1,
unknown = 2,
ASCII = 3,
@@ -88,8 +95,6 @@ struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
ISO2IntlRefVersion = 30,
NATSSEFI = 31,
NATSSEFIADD = 32,
- NATSDANO = 33,
- NATSDANOADD = 34,
ISO10Swedish = 35,
KSC56011987 = 36,
ISO2022KR = 37,
@@ -255,7 +260,7 @@ struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
IBM880 = 2057,
IBM891 = 2058,
IBM903 = 2059,
- IBBM904 = 2060,
+ IBM904 = 2060,
IBM905 = 2061,
IBM918 = 2062,
IBM1026 = 2063,
@@ -315,24 +320,23 @@ struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
windows1257 = 2257,
windows1258 = 2258,
TIS620 = 2259,
- CP50220 = 2260,
- reserved = 3000
+ CP50220 = 2260
};
using enum id;
_LIBCPP_HIDE_FROM_ABI constexpr text_encoding() = default;
- _LIBCPP_HIDE_FROM_ABI constexpr explicit text_encoding(string_view __enc) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit text_encoding(string_view __enc) noexcept
: __encoding_rep_(__find_encoding_data(__enc)) {
__enc.copy(__name_, max_name_length, 0);
}
- _LIBCPP_HIDE_FROM_ABI constexpr text_encoding(id __i) _NOEXCEPT : __encoding_rep_(__find_encoding_data_by_id(__i)) {
- if (__encoding_rep_->__name[0] != '\0')
- std::copy_n(__encoding_rep_->__name, std::char_traits<char>::length(__encoding_rep_->__name), __name_);
+ _LIBCPP_HIDE_FROM_ABI constexpr text_encoding(id __i) noexcept : __encoding_rep_(__find_encoding_data_by_id(__i)) {
+ if (__encoding_rep_->__name_[0] != '\0')
+ std::copy_n(__encoding_rep_->__name_, std::char_traits<char>::length(__encoding_rep_->__name_), __name_);
}
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr id mib() const _NOEXCEPT { return id(__encoding_rep_->__mib_rep); }
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const char* name() const _NOEXCEPT { return __name_; }
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr id mib() const noexcept { return id(__encoding_rep_->__mib_rep_); }
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr const char* name() const noexcept { return __name_; }
// [text.encoding.aliases], class text_encoding::aliases_view
struct aliases_view : ranges::view_interface<aliases_view> {
@@ -340,16 +344,15 @@ struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
constexpr aliases_view(const __encoding_data* __d) : __view_data_(__d) {}
struct __end_sentinel {};
struct __iterator {
- using value_type = const char*;
- using reference = const char*;
- using difference_type = ptrdiff_t;
+ using value_type = const char*;
+ using reference = const char*;
+ using difference_type = ptrdiff_t;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator() noexcept = default;
- _LIBCPP_HIDE_FROM_ABI constexpr __iterator() noexcept = default;
-
_LIBCPP_HIDE_FROM_ABI constexpr value_type operator*() const {
- if (__can_dereference())
- return __data_->__name;
- std::unreachable();
+ _LIBCPP_ASSERT(__can_dereference(), "Dereferencing invalid aliases_view iterator!");
+ return __data_->__name_;
}
_LIBCPP_HIDE_FROM_ABI constexpr value_type operator[](difference_type __n) const {
@@ -368,19 +371,17 @@ struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
}
_LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(__iterator __it, difference_type __n) {
- __it -= __n;
+ __it -= __n;
return __it;
}
- _LIBCPP_HIDE_FROM_ABI constexpr difference_type operator-(const __iterator& __other) const
- {
- if(__other.__mib_rep_ == __mib_rep_)
- return __mib_rep_ - __other.__mib_rep_;
- std::unreachable();
+ _LIBCPP_HIDE_FROM_ABI constexpr difference_type operator-(const __iterator& __other) const {
+ _LIBCPP_ASSERT(__other.__mib_rep_ == __mib_rep_, "Subtracting ranges of two different text encodings!");
+ return __mib_rep_ - __other.__mib_rep_;
}
_LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(difference_type __n, __iterator& __it) {
- __it -= __n;
+ __it -= __n;
return __it;
}
@@ -409,14 +410,14 @@ struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
// Check if going past the encoding data list array and if the new index has the same id, if not then
// replace it with a sentinel "out-of-bounds" iterator.
_LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __n) {
- if (__data_) [[__likely__]] {
+ if (__data_) {
if (__n > 0) {
- if ((__data_ + __n) < std::end(__text_encoding_data) && __data_[__n - 1].__mib_rep == __mib_rep_)
+ if ((__data_ + __n) < std::end(__text_encoding_data) && __data_[__n - 1].__mib_rep_ == __mib_rep_)
__data_ += __n;
else
*this = __iterator{};
} else if (__n < 0) {
- if ((__data_ + __n) > __text_encoding_data && __data_[__n].__mib_rep == __mib_rep_)
+ if ((__data_ + __n) > __text_encoding_data && __data_[__n].__mib_rep_ == __mib_rep_)
__data_ += __n;
else
*this = __iterator{};
@@ -439,13 +440,15 @@ struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
friend struct text_encoding;
_LIBCPP_HIDE_FROM_ABI constexpr __iterator(const __encoding_data* __enc_d) noexcept
- : __data_(__enc_d), __mib_rep_(__enc_d ? __enc_d->__mib_rep : 0) {}
+ : __data_(__enc_d), __mib_rep_(__enc_d ? __enc_d->__mib_rep_ : 0) {}
- _LIBCPP_HIDE_FROM_ABI bool __can_dereference() const { return __data_ && __data_->__mib_rep == __mib_rep_; }
+ _LIBCPP_HIDE_FROM_ABI constexpr bool __can_dereference() const {
+ return __data_ && __data_->__mib_rep_ == __mib_rep_;
+ }
// default iterator is a sentinel
- const __encoding_data* __data_ = nullptr;
- __encoding_data::__id_rep __mib_rep_ = 0;
+ const __encoding_data* __data_ = nullptr;
+ __id_rep __mib_rep_ = 0;
};
constexpr __iterator begin() const { return __iterator{__view_data_}; }
@@ -455,55 +458,47 @@ struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
const __encoding_data* __view_data_ = nullptr;
};
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr aliases_view aliases() const _NOEXCEPT {
- auto __rep = __encoding_rep_ - 1;
- if (__encoding_rep_->__name[0]) {
- while (__rep > std::begin(__text_encoding_data) && (__rep--)->__mib_rep == __encoding_rep_->__mib_rep)
- ;
- } else {
- __rep = nullptr;
- }
-
- return aliases_view(__rep);
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr aliases_view aliases() const noexcept {
+ if (!__encoding_rep_->__name_[0])
+ return aliases_view(nullptr);
+ return aliases_view(__encoding_rep_);
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const text_encoding& __a, const text_encoding& __b) _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const text_encoding& __a, const text_encoding& __b) noexcept {
if (__a.mib() == id::other && __b.mib() == id::other)
return __comp_name(__a.__name_, __b.__name_);
return __a.mib() == __b.mib();
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const text_encoding& __encoding, id __i) _NOEXCEPT {
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const text_encoding& __encoding, id __i) noexcept {
return __encoding.mib() == __i;
}
-# if __CHAR_BIT__ == 8
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static consteval text_encoding literal() _NOEXCEPT {
-# ifdef __GNUC_EXECUTION_CHARSET_NAME
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static consteval text_encoding literal() noexcept {
+ // TODO: Remove this branch once we have __GNUC_EXECUTION_CHARSET_NAME or __clang_literal_encoding__ unconditionally
+# ifdef __GNUC_EXECUTION_CHARSET_NAME
return text_encoding(__GNUC_EXECUTION_CHARSET_NAME);
-# elif defined(__clang_literal_encoding__)
+# elif defined(__clang_literal_encoding__)
return text_encoding(__clang_literal_encoding__);
-# elif defined(__clang__)
- return text_encoding(id::UTF8);
-# else
- return {};
-# endif
+# else
+ return text_encoding();
+# endif
}
- [[nodiscard]] static text_encoding environment();
+# if _LIBCPP_HAS_LOCALIZATION
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static text_encoding environment() {
+ return text_encoding(__get_locale_encoding(""));
+ }
template <id __i>
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool environment_is() {
return environment() == __i;
}
-
-# else
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static consteval text_encoding literal() = delete;
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static text_encoding environment() = delete;
- template <id __i>
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool environment_is() = delete;
-# endif
+# else
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static text_encoding environment() = delete;
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static bool environment_is() = delete;
+# endif // _LIBCPP_HAS_LOCALIZATION
private:
_LIBCPP_HIDE_FROM_ABI static constexpr bool __comp_name(string_view __a, string_view __b) {
@@ -544,916 +539,915 @@ struct _LIBCPP_EXPORTED_FROM_ABI text_encoding {
}
_LIBCPP_HIDE_FROM_ABI static constexpr const __encoding_data* __find_encoding_data(string_view __a) {
- auto __data_ptr = __text_encoding_data + 2, __data_last = std::end(__text_encoding_data) - 1;
-
- for (; __data_ptr != __data_last; __data_ptr++) {
- if (__comp_name(__a, __data_ptr->__name)) {
- const auto __found_id = __data_ptr->__mib_rep;
- while (__data_ptr[-1].__mib_rep == __found_id)
- __data_ptr--;
- return __data_ptr;
- }
+ _LIBCPP_ASSERT(__a.size() <= max_name_length, "Passing encoding name longer than max_name_length!");
+ auto __data_ptr = __text_encoding_data + 2, __data_last = std::end(__text_encoding_data);
+ auto __found_data = std::find(__data_ptr, __data_last, __a);
+
+ if (__found_data == __data_last) {
+ return __text_encoding_data; // other
+ }
+
+ while (__found_data[-1].__mib_rep_ == __found_data->__mib_rep_) {
+ __found_data--;
}
- return __text_encoding_data; // other
+ return __found_data;
}
_LIBCPP_HIDE_FROM_ABI static constexpr const __encoding_data* __find_encoding_data_by_id(id __i) {
- auto __found = std::lower_bound(
- std::begin(__text_encoding_data), std::end(__text_encoding_data) - 1, __encoding_data::__id_rep(__i));
- return __found != std::end(__text_encoding_data) - 1 ? __found : __text_encoding_data + 1; // unknown
+ _LIBCPP_ASSERT(__i >= id::other && __i <= id::CP50220 && __id_rep(__i) != 33 && __id_rep(__i) != 34,
+ "Passing invalid id to text_encoding constructor!");
+ auto __found = std::lower_bound(std::begin(__text_encoding_data), std::end(__text_encoding_data), __id_rep(__i));
+ return __found != std::end(__text_encoding_data)
+ ? __found
+ : __text_encoding_data + 1; // unknown, should be unreachable
}
_LIBCPP_HIDE_FROM_ABI static constexpr __encoding_data __text_encoding_data[] = {
- {1, ""},
- {2, ""},
- {3, "ANSI_X3.4-1968"},
- {3, "ANSI_X3.4-1986"},
- {3, "IBM367"},
- {3, "ISO646-US"},
- {3, "ISO_646.irv:1991"},
- {3, "cp367"},
- {3, "csASCII"},
- {3, "iso-ir-6"},
- {3, "us"},
- {4, "ISO-8859-1"},
- {4, "ISO_8859-1:1987"},
- {4, "CP819"},
- {4, "IBM819"},
- {4, "ISO_8859-1"},
- {4, "csISOLatin1"},
- {4, "iso-ir-100"},
- {4, "l1"},
- {4, "latin1"},
- {5, "ISO-8859-2"},
- {5, "ISO_8859-2:1987"},
- {5, "ISO_8859-2"},
- {5, "csISOLatin2"},
- {5, "iso-ir-101"},
- {5, "l2"},
- {5, "latin2"},
- {6, "ISO-8859-3"},
- {6, "ISO_8859-3:1988"},
- {6, "ISO_8859-3"},
- {6, "csISOLatin3"},
- {6, "iso-ir-109"},
- {6, "l3"},
- {6, "latin3"},
- {7, "ISO-8859-4"},
- {7, "ISO_8859-4:1988"},
- {7, "ISO_8859-4"},
- {7, "csISOLatin4"},
- {7, "iso-ir-110"},
- {7, "l4"},
- {7, "latin4"},
- {8, "ISO-8859-5"},
- {8, "ISO_8859-5:1988"},
- {8, "ISO_8859-5"},
- {8, "csISOLatinCyrillic"},
- {8, "cyrillic"},
- {8, "iso-ir-144"},
- {9, "ISO-8859-6"},
- {9, "ISO_8859-6:1987"},
- {9, "ASMO-708"},
- {9, "ECMA-114"},
- {9, "ISO_8859-6"},
- {9, "arabic"},
- {9, "csISOLatinArabic"},
- {9, "iso-ir-127"},
- {10, "ISO-8859-7"},
- {10, "ISO_8859-7:1987"},
- {10, "ECMA-118"},
- {10, "ELOT_928"},
- {10, "ISO_8859-7"},
- {10, "csISOLatinGreek"},
- {10, "greek"},
- {10, "greek8"},
- {10, "iso-ir-126"},
- {11, "ISO-8859-8"},
- {11, "ISO_8859-8:1988"},
- {11, "ISO_8859-8"},
- {11, "csISOLatinHebrew"},
- {11, "hebrew"},
- {11, "iso-ir-138"},
- {12, "ISO-8859-9"},
- {12, "ISO_8859-9:1989"},
- {12, "ISO_8859-9"},
- {12, "csISOLatin5"},
- {12, "iso-ir-148"},
- {12, "l5"},
- {12, "latin5"},
- {13, "ISO-8859-10"},
- {13, "ISO_8859-10:1992"},
- {13, "csISOLatin6"},
- {13, "iso-ir-157"},
- {13, "l6"},
- {13, "latin6"},
- {14, "ISO_6937-2-add"},
- {14, "csISOTextComm"},
- {14, "iso-ir-142"},
- {15, "JIS_X0201"},
- {15, "X0201"},
- {15, "csHalfWidthKatakana"},
- {16, "JIS_Encoding"},
- {16, "csJISEncoding"},
- {17, "Shift_JIS"},
- {17, "MS_Kanji"},
- {17, "csShiftJIS"},
- {18, "EUC-JP"},
- {18, "Extended_UNIX_Code_Packed_Format_for_Japanese"},
- {18, "csEUCPkdFmtJapanese"},
- {19, "Extended_UNIX_Code_Fixed_Width_for_Japanese"},
- {19, "csEUCFixWidJapanese"},
- {20, "BS_4730"},
- {20, "ISO646-GB"},
- {20, "csISO4UnitedKingdom"},
- {20, "gb"},
- {20, "iso-ir-4"},
- {20, "uk"},
- {21, "SEN_850200_C"},
- {21, "ISO646-SE2"},
- {21, "csISO11SwedishForNames"},
- {21, "iso-ir-11"},
- {21, "se2"},
- {22, "IT"},
- {22, "ISO646-IT"},
- {22, "csISO15Italian"},
- {22, "iso-ir-15"},
- {23, "ES"},
- {23, "ISO646-ES"},
- {23, "csISO17Spanish"},
- {23, "iso-ir-17"},
- {24, "DIN_66003"},
- {24, "ISO646-DE"},
- {24, "csISO21German"},
- {24, "de"},
- {24, "iso-ir-21"},
- {25, "NS_4551-1"},
- {25, "ISO646-NO"},
- {25, "csISO60DanishNorwegian"},
- {25, "csISO60Norwegian1"},
- {25, "iso-ir-60"},
- {25, "no"},
- {26, "NF_Z_62-010"},
- {26, "ISO646-FR"},
- {26, "csISO69French"},
- {26, "fr"},
- {26, "iso-ir-69"},
- {27, "ISO-10646-UTF-1"},
- {27, "csISO10646UTF1"},
- {28, "ISO_646.basic:1983"},
- {28, "csISO646basic1983"},
- {28, "ref"},
- {29, "INVARIANT"},
- {29, "csINVARIANT"},
- {30, "ISO_646.irv:1983"},
- {30, "csISO2IntlRefVersion"},
- {30, "irv"},
- {30, "iso-ir-2"},
- {31, "NATS-SEFI"},
- {31, "csNATSSEFI"},
- {31, "iso-ir-8-1"},
- {32, "NATS-SEFI-ADD"},
- {32, "csNATSSEFIADD"},
- {32, "iso-ir-8-2"},
- {33, "NATS-DANO"},
- {33, "csNATSDANO"},
- {33, "iso-ir-9-1"},
- {34, "NATS-DANO-ADD"},
- {34, "csNATSDANOADD"},
- {34, "iso-ir-9-2"},
- {35, "SEN_850200_B"},
- {35, "FI"},
- {35, "ISO646-FI"},
- {35, "ISO646-SE"},
- {35, "csISO10Swedish"},
- {35, "iso-ir-10"},
- {35, "se"},
- {36, "KS_C_5601-1987"},
- {36, "KSC_5601"},
- {36, "KS_C_5601-1989"},
- {36, "csKSC56011987"},
- {36, "iso-ir-149"},
- {36, "korean"},
- {37, "ISO-2022-KR"},
- {37, "csISO2022KR"},
- {38, "EUC-KR"},
- {38, "csEUCKR"},
- {39, "ISO-2022-JP"},
- {39, "csISO2022JP"},
- {40, "ISO-2022-JP-2"},
- {40, "csISO2022JP2"},
- {41, "JIS_C6220-1969-jp"},
- {41, "JIS_C6220-1969"},
- {41, "csISO13JISC6220jp"},
- {41, "iso-ir-13"},
- {41, "katakana"},
- {41, "x0201-7"},
- {42, "JIS_C6220-1969-ro"},
- {42, "ISO646-JP"},
- {42, "csISO14JISC6220ro"},
- {42, "iso-ir-14"},
- {42, "jp"},
- {43, "PT"},
- {43, "ISO646-PT"},
- {43, "csISO16Portuguese"},
- {43, "iso-ir-16"},
- {44, "greek7-old"},
- {44, "csISO18Greek7Old"},
- {44, "iso-ir-18"},
- {45, "latin-greek"},
- {45, "csISO19LatinGreek"},
- {45, "iso-ir-19"},
- {46, "NF_Z_62-010_(1973)"},
- {46, "ISO646-FR1"},
- {46, "csISO25French"},
- {46, "iso-ir-25"},
- {47, "Latin-greek-1"},
- {47, "csISO27LatinGreek1"},
- {47, "iso-ir-27"},
- {48, "ISO_5427"},
- {48, "csISO5427Cyrillic"},
- {48, "iso-ir-37"},
- {49, "JIS_C6226-1978"},
- {49, "csISO42JISC62261978"},
- {49, "iso-ir-42"},
- {50, "BS_viewdata"},
- {50, "csISO47BSViewdata"},
- {50, "iso-ir-47"},
- {51, "INIS"},
- {51, "csISO49INIS"},
- {51, "iso-ir-49"},
- {52, "INIS-8"},
- {52, "csISO50INIS8"},
- {52, "iso-ir-50"},
- {53, "INIS-cyrillic"},
- {53, "csISO51INISCyrillic"},
- {53, "iso-ir-51"},
- {54, "ISO_5427:1981"},
- {54, "ISO5427Cyrillic1981"},
- {54, "csISO54271981"},
- {54, "iso-ir-54"},
- {55, "ISO_5428:1980"},
- {55, "csISO5428Greek"},
- {55, "iso-ir-55"},
- {56, "GB_1988-80"},
- {56, "ISO646-CN"},
- {56, "cn"},
- {56, "csISO57GB1988"},
- {56, "iso-ir-57"},
- {57, "GB_2312-80"},
- {57, "chinese"},
- {57, "csISO58GB231280"},
- {57, "iso-ir-58"},
- {58, "NS_4551-2"},
- {58, "ISO646-NO2"},
- {58, "csISO61Norwegian2"},
- {58, "iso-ir-61"},
- {58, "no2"},
- {59, "videotex-suppl"},
- {59, "csISO70VideotexSupp1"},
- {59, "iso-ir-70"},
- {60, "PT2"},
- {60, "ISO646-PT2"},
- {60, "csISO84Portuguese2"},
- {60, "iso-ir-84"},
- {61, "ES2"},
- {61, "ISO646-ES2"},
- {61, "csISO85Spanish2"},
- {61, "iso-ir-85"},
- {62, "MSZ_7795.3"},
- {62, "ISO646-HU"},
- {62, "csISO86Hungarian"},
- {62, "hu"},
- {62, "iso-ir-86"},
- {63, "JIS_C6226-1983"},
- {63, "JIS_X0208-1983"},
- {63, "csISO87JISX0208"},
- {63, "iso-ir-87"},
- {63, "x0208"},
- {64, "greek7"},
- {64, "csISO88Greek7"},
- {64, "iso-ir-88"},
- {65, "ASMO_449"},
- {65, "ISO_9036"},
- {65, "arabic7"},
- {65, "csISO89ASMO449"},
- {65, "iso-ir-89"},
- {66, "iso-ir-90"},
- {66, "csISO90"},
- {67, "JIS_C6229-1984-a"},
- {67, "csISO91JISC62291984a"},
- {67, "iso-ir-91"},
- {67, "jp-ocr-a"},
- {68, "JIS_C6229-1984-b"},
- {68, "ISO646-JP-OCR-B"},
- {68, "csISO92JISC62991984b"},
- {68, "iso-ir-92"},
- {68, "jp-ocr-b"},
- {69, "JIS_C6229-1984-b-add"},
- {69, "csISO93JIS62291984badd"},
- {69, "iso-ir-93"},
- {69, "jp-ocr-b-add"},
- {70, "JIS_C6229-1984-hand"},
- {70, "csISO94JIS62291984hand"},
- {70, "iso-ir-94"},
- {70, "jp-ocr-hand"},
- {71, "JIS_C6229-1984-hand-add"},
- {71, "csISO95JIS62291984handadd"},
- {71, "iso-ir-95"},
- {71, "jp-ocr-hand-add"},
- {72, "JIS_C6229-1984-kana"},
- {72, "csISO96JISC62291984kana"},
- {72, "iso-ir-96"},
- {73, "ISO_2033-1983"},
- {73, "csISO2033"},
- {73, "e13b"},
- {73, "iso-ir-98"},
- {74, "ANSI_X3.110-1983"},
- {74, "CSA_T500-1983"},
- {74, "NAPLPS"},
- {74, "csISO99NAPLPS"},
- {74, "iso-ir-99"},
- {75, "T.61-7bit"},
- {75, "csISO102T617bit"},
- {75, "iso-ir-102"},
- {76, "T.61-8bit"},
- {76, "T.61"},
- {76, "csISO103T618bit"},
- {76, "iso-ir-103"},
- {77, "ECMA-cyrillic"},
- {77, "KOI8-E"},
- {77, "csISO111ECMACyrillic"},
- {77, "iso-ir-111"},
- {78, "CSA_Z243.4-1985-1"},
- {78, "ISO646-CA"},
- {78, "ca"},
- {78, "csISO121Canadian1"},
- {78, "csa7-1"},
- {78, "csa71"},
- {78, "iso-ir-121"},
- {79, "CSA_Z243.4-1985-2"},
- {79, "ISO646-CA2"},
- {79, "csISO122Canadian2"},
- {79, "csa7-2"},
- {79, "csa72"},
- {79, "iso-ir-122"},
- {80, "CSA_Z243.4-1985-gr"},
- {80, "csISO123CSAZ24341985gr"},
- {80, "iso-ir-123"},
- {81, "ISO-8859-6-E"},
- {81, "ISO_8859-6-E"},
- {81, "csISO88596E"},
- {82, "ISO-8859-6-I"},
- {82, "ISO_8859-6-I"},
- {82, "csISO88596I"},
- {83, "T.101-G2"},
- {83, "csISO128T101G2"},
- {83, "iso-ir-128"},
- {84, "ISO-8859-8-E"},
- {84, "ISO_8859-8-E"},
- {84, "csISO88598E"},
- {85, "ISO-8859-8-I"},
- {85, "ISO_8859-8-I"},
- {85, "csISO88598I"},
- {86, "CSN_369103"},
- {86, "csISO139CSN369103"},
- {86, "iso-ir-139"},
- {87, "JUS_I.B1.002"},
- {87, "ISO646-YU"},
- {87, "csISO141JUSIB1002"},
- {87, "iso-ir-141"},
- {87, "js"},
- {87, "yu"},
- {88, "IEC_P27-1"},
- {88, "csISO143IECP271"},
- {88, "iso-ir-143"},
- {89, "JUS_I.B1.003-serb"},
- {89, "csISO146Serbian"},
- {89, "iso-ir-146"},
- {89, "serbian"},
- {90, "JUS_I.B1.003-mac"},
- {90, "csISO147Macedonian"},
- {90, "iso-ir-147"},
- {90, "macedonian"},
- {91, "greek-ccitt"},
- {91, "csISO150"},
- {91, "csISO150GreekCCITT"},
- {91, "iso-ir-150"},
- {92, "NC_NC00-10:81"},
- {92, "ISO646-CU"},
- {92, "csISO151Cuba"},
- {92, "cuba"},
- {92, "iso-ir-151"},
- {93, "ISO_6937-2-25"},
- {93, "csISO6937Add"},
- {93, "iso-ir-152"},
- {94, "GOST_19768-74"},
- {94, "ST_SEV_358-88"},
- {94, "csISO153GOST1976874"},
- {94, "iso-ir-153"},
- {95, "ISO_8859-supp"},
- {95, "csISO8859Supp"},
- {95, "iso-ir-154"},
- {95, "latin1-2-5"},
- {96, "ISO_10367-box"},
- {96, "csISO10367Box"},
- {96, "iso-ir-155"},
- {97, "latin-lap"},
- {97, "csISO158Lap"},
- {97, "iso-ir-158"},
- {97, "lap"},
- {98, "JIS_X0212-1990"},
- {98, "csISO159JISX02121990"},
- {98, "iso-ir-159"},
- {98, "x0212"},
- {99, "DS_2089"},
- {99, "DS2089"},
- {99, "ISO646-DK"},
- {99, "csISO646Danish"},
- {99, "dk"},
- {100, "us-dk"},
- {100, "csUSDK"},
- {101, "dk-us"},
- {101, "csDKUS"},
- {102, "KSC5636"},
- {102, "ISO646-KR"},
- {102, "csKSC5636"},
- {103, "UNICODE-1-1-UTF-7"},
- {103, "csUnicode11UTF7"},
- {104, "ISO-2022-CN"},
- {104, "csISO2022CN"},
- {105, "ISO-2022-CN-EXT"},
- {105, "csISO2022CNEXT"},
- {106, "UTF-8"},
- {106, "csUTF8"},
- {109, "ISO-8859-13"},
- {109, "csISO885913"},
- {110, "ISO-8859-14"},
- {110, "ISO_8859-14"},
- {110, "ISO_8859-14:1998"},
- {110, "csISO885914"},
- {110, "iso-celtic"},
- {110, "iso-ir-199"},
- {110, "l8"},
- {110, "latin8"},
- {111, "ISO-8859-15"},
- {111, "ISO_8859-15"},
- {111, "Latin-9"},
- {111, "csISO885915"},
- {112, "ISO-8859-16"},
- {112, "ISO_8859-16"},
- {112, "ISO_8859-16:2001"},
- {112, "csISO885916"},
- {112, "iso-ir-226"},
- {112, "l10"},
- {112, "latin10"},
- {113, "GBK"},
- {113, "CP936"},
- {113, "MS936"},
- {113, "csGBK"},
- {113, "windows-936"},
- {114, "GB18030"},
- {114, "csGB18030"},
- {115, "OSD_EBCDIC_DF04_15"},
- {115, "csOSDEBCDICDF0415"},
- {116, "OSD_EBCDIC_DF03_IRV"},
- {116, "csOSDEBCDICDF03IRV"},
- {117, "OSD_EBCDIC_DF04_1"},
- {117, "csOSDEBCDICDF041"},
- {118, "ISO-11548-1"},
- {118, "ISO_11548-1"},
- {118, "ISO_TR_11548-1"},
- {118, "csISO115481"},
- {119, "KZ-1048"},
- {119, "RK1048"},
- {119, "STRK1048-2002"},
- {119, "csKZ1048"},
- {1000, "ISO-10646-UCS-2"},
- {1000, "csUnicode"},
- {1001, "ISO-10646-UCS-4"},
- {1001, "csUCS4"},
- {1002, "ISO-10646-UCS-Basic"},
- {1002, "csUnicodeASCII"},
- {1003, "ISO-10646-Unicode-Latin1"},
- {1003, "ISO-10646"},
- {1003, "csUnicodeLatin1"},
- {1004, "ISO-10646-J-1"},
- {1004, "csUnicodeJapanese"},
- {1005, "ISO-Unicode-IBM-1261"},
- {1005, "csUnicodeIBM1261"},
- {1006, "ISO-Unicode-IBM-1268"},
- {1006, "csUnicodeIBM1268"},
- {1007, "ISO-Unicode-IBM-1276"},
- {1007, "csUnicodeIBM1276"},
- {1008, "ISO-Unicode-IBM-1264"},
- {1008, "csUnicodeIBM1264"},
- {1009, "ISO-Unicode-IBM-1265"},
- {1009, "csUnicodeIBM1265"},
- {1010, "UNICODE-1-1"},
- {1010, "csUnicode11"},
- {1011, "SCSU"},
- {1011, "csSCSU"},
- {1012, "UTF-7"},
- {1012, "csUTF7"},
- {1013, "UTF-16BE"},
- {1013, "csUTF16BE"},
- {1014, "UTF-16LE"},
- {1014, "csUTF16LE"},
- {1015, "UTF-16"},
- {1015, "csUTF16"},
- {1016, "CESU-8"},
- {1016, "csCESU-8"},
- {1016, "csCESU8"},
- {1017, "UTF-32"},
- {1017, "csUTF32"},
- {1018, "UTF-32BE"},
- {1018, "csUTF32BE"},
- {1019, "UTF-32LE"},
- {1019, "csUTF32LE"},
- {1020, "BOCU-1"},
- {1020, "csBOCU-1"},
- {1020, "csBOCU1"},
- {1021, "UTF-7-IMAP"},
- {1021, "csUTF7IMAP"},
- {2000, "ISO-8859-1-Windows-3.0-Latin-1"},
- {2000, "csWindows30Latin1"},
- {2001, "ISO-8859-1-Windows-3.1-Latin-1"},
- {2001, "csWindows31Latin1"},
- {2002, "ISO-8859-2-Windows-Latin-2"},
- {2002, "csWindows31Latin2"},
- {2003, "ISO-8859-9-Windows-Latin-5"},
- {2003, "csWindows31Latin5"},
- {2004, "hp-roman8"},
- {2004, "csHPRoman8"},
- {2004, "r8"},
- {2004, "roman8"},
- {2005, "Adobe-Standard-Encoding"},
- {2005, "csAdobeStandardEncoding"},
- {2006, "Ventura-US"},
- {2006, "csVenturaUS"},
- {2007, "Ventura-International"},
- {2007, "csVenturaInternational"},
- {2008, "DEC-MCS"},
- {2008, "csDECMCS"},
- {2008, "dec"},
- {2009, "IBM850"},
- {2009, "850"},
- {2009, "cp850"},
- {2009, "csPC850Multilingual"},
- {2010, "IBM852"},
- {2010, "852"},
- {2010, "cp852"},
- {2010, "csPCp852"},
- {2011, "IBM437"},
- {2011, "437"},
- {2011, "cp437"},
- {2011, "csPC8CodePage437"},
- {2012, "PC8-Danish-Norwegian"},
- {2012, "csPC8DanishNorwegian"},
- {2013, "IBM862"},
- {2013, "862"},
- {2013, "cp862"},
- {2013, "csPC862LatinHebrew"},
- {2014, "PC8-Turkish"},
- {2014, "csPC8Turkish"},
- {2015, "IBM-Symbols"},
- {2015, "csIBMSymbols"},
- {2016, "IBM-Thai"},
- {2016, "csIBMThai"},
- {2017, "HP-Legal"},
- {2017, "csHPLegal"},
- {2018, "HP-Pi-font"},
- {2018, "csHPPiFont"},
- {2019, "HP-Math8"},
- {2019, "csHPMath8"},
- {2020, "Adobe-Symbol-Encoding"},
- {2020, "csHPPSMath"},
- {2021, "HP-DeskTop"},
- {2021, "csHPDesktop"},
- {2022, "Ventura-Math"},
- {2022, "csVenturaMath"},
- {2023, "Microsoft-Publishing"},
- {2023, "csMicrosoftPublishing"},
- {2024, "Windows-31J"},
- {2024, "csWindows31J"},
- {2025, "GB2312"},
- {2025, "csGB2312"},
- {2026, "Big5"},
- {2026, "csBig5"},
- {2027, "macintosh"},
- {2027, "csMacintosh"},
- {2027, "mac"},
- {2028, "IBM037"},
- {2028, "cp037"},
- {2028, "csIBM037"},
- {2028, "ebcdic-cp-ca"},
- {2028, "ebcdic-cp-nl"},
- {2028, "ebcdic-cp-us"},
- {2028, "ebcdic-cp-wt"},
- {2029, "IBM038"},
- {2029, "EBCDIC-INT"},
- {2029, "cp038"},
- {2029, "csIBM038"},
- {2030, "IBM273"},
- {2030, "CP273"},
- {2030, "csIBM273"},
- {2031, "IBM274"},
- {2031, "CP274"},
- {2031, "EBCDIC-BE"},
- {2031, "csIBM274"},
- {2032, "IBM275"},
- {2032, "EBCDIC-BR"},
- {2032, "cp275"},
- {2032, "csIBM275"},
- {2033, "IBM277"},
- {2033, "EBCDIC-CP-DK"},
- {2033, "EBCDIC-CP-NO"},
- {2033, "csIBM277"},
- {2034, "IBM278"},
- {2034, "CP278"},
- {2034, "csIBM278"},
- {2034, "ebcdic-cp-fi"},
- {2034, "ebcdic-cp-se"},
- {2035, "IBM280"},
- {2035, "CP280"},
- {2035, "csIBM280"},
- {2035, "ebcdic-cp-it"},
- {2036, "IBM281"},
- {2036, "EBCDIC-JP-E"},
- {2036, "cp281"},
- {2036, "csIBM281"},
- {2037, "IBM284"},
- {2037, "CP284"},
- {2037, "csIBM284"},
- {2037, "ebcdic-cp-es"},
- {2038, "IBM285"},
- {2038, "CP285"},
- {2038, "csIBM285"},
- {2038, "ebcdic-cp-gb"},
- {2039, "IBM290"},
- {2039, "EBCDIC-JP-kana"},
- {2039, "cp290"},
- {2039, "csIBM290"},
- {2040, "IBM297"},
- {2040, "cp297"},
- {2040, "csIBM297"},
- {2040, "ebcdic-cp-fr"},
- {2041, "IBM420"},
- {2041, "cp420"},
- {2041, "csIBM420"},
- {2041, "ebcdic-cp-ar1"},
- {2042, "IBM423"},
- {2042, "cp423"},
- {2042, "csIBM423"},
- {2042, "ebcdic-cp-gr"},
- {2043, "IBM424"},
- {2043, "cp424"},
- {2043, "csIBM424"},
- {2043, "ebcdic-cp-he"},
- {2044, "IBM500"},
- {2044, "CP500"},
- {2044, "csIBM500"},
- {2044, "ebcdic-cp-be"},
- {2044, "ebcdic-cp-ch"},
- {2045, "IBM851"},
- {2045, "851"},
- {2045, "cp851"},
- {2045, "csIBM851"},
- {2046, "IBM855"},
- {2046, "855"},
- {2046, "cp855"},
- {2046, "csIBM855"},
- {2047, "IBM857"},
- {2047, "857"},
- {2047, "cp857"},
- {2047, "csIBM857"},
- {2048, "IBM860"},
- {2048, "860"},
- {2048, "cp860"},
- {2048, "csIBM860"},
- {2049, "IBM861"},
- {2049, "861"},
- {2049, "cp-is"},
- {2049, "cp861"},
- {2049, "csIBM861"},
- {2050, "IBM863"},
- {2050, "863"},
- {2050, "cp863"},
- {2050, "csIBM863"},
- {2051, "IBM864"},
- {2051, "cp864"},
- {2051, "csIBM864"},
- {2052, "IBM865"},
- {2052, "865"},
- {2052, "cp865"},
- {2052, "csIBM865"},
- {2053, "IBM868"},
- {2053, "CP868"},
- {2053, "cp-ar"},
- {2053, "csIBM868"},
- {2054, "IBM869"},
- {2054, "869"},
- {2054, "cp-gr"},
- {2054, "cp869"},
- {2054, "csIBM869"},
- {2055, "IBM870"},
- {2055, "CP870"},
- {2055, "csIBM870"},
- {2055, "ebcdic-cp-roece"},
- {2055, "ebcdic-cp-yu"},
- {2056, "IBM871"},
- {2056, "CP871"},
- {2056, "csIBM871"},
- {2056, "ebcdic-cp-is"},
- {2057, "IBM880"},
- {2057, "EBCDIC-Cyrillic"},
- {2057, "cp880"},
- {2057, "csIBM880"},
- {2058, "IBM891"},
- {2058, "cp891"},
- {2058, "csIBM891"},
- {2059, "IBM903"},
- {2059, "cp903"},
- {2059, "csIBM903"},
- {2060, "IBM904"},
- {2060, "904"},
- {2060, "cp904"},
- {2060, "csIBBM904"},
- {2061, "IBM905"},
- {2061, "CP905"},
- {2061, "csIBM905"},
- {2061, "ebcdic-cp-tr"},
- {2062, "IBM918"},
- {2062, "CP918"},
- {2062, "csIBM918"},
- {2062, "ebcdic-cp-ar2"},
- {2063, "IBM1026"},
- {2063, "CP1026"},
- {2063, "csIBM1026"},
- {2064, "EBCDIC-AT-DE"},
- {2064, "csIBMEBCDICATDE"},
- {2065, "EBCDIC-AT-DE-A"},
- {2065, "csEBCDICATDEA"},
- {2066, "EBCDIC-CA-FR"},
- {2066, "csEBCDICCAFR"},
- {2067, "EBCDIC-DK-NO"},
- {2067, "csEBCDICDKNO"},
- {2068, "EBCDIC-DK-NO-A"},
- {2068, "csEBCDICDKNOA"},
- {2069, "EBCDIC-FI-SE"},
- {2069, "csEBCDICFISE"},
- {2070, "EBCDIC-FI-SE-A"},
- {2070, "csEBCDICFISEA"},
- {2071, "EBCDIC-FR"},
- {2071, "csEBCDICFR"},
- {2072, "EBCDIC-IT"},
- {2072, "csEBCDICIT"},
- {2073, "EBCDIC-PT"},
- {2073, "csEBCDICPT"},
- {2074, "EBCDIC-ES"},
- {2074, "csEBCDICES"},
- {2075, "EBCDIC-ES-A"},
- {2075, "csEBCDICESA"},
- {2076, "EBCDIC-ES-S"},
- {2076, "csEBCDICESS"},
- {2077, "EBCDIC-UK"},
- {2077, "csEBCDICUK"},
- {2078, "EBCDIC-US"},
- {2078, "csEBCDICUS"},
- {2079, "UNKNOWN-8BIT"},
- {2079, "csUnknown8BiT"},
- {2080, "MNEMONIC"},
- {2080, "csMnemonic"},
- {2081, "MNEM"},
- {2081, "csMnem"},
- {2082, "VISCII"},
- {2082, "csVISCII"},
- {2083, "VIQR"},
- {2083, "csVIQR"},
- {2084, "KOI8-R"},
- {2084, "csKOI8R"},
- {2085, "HZ-GB-2312"},
- {2086, "IBM866"},
- {2086, "866"},
- {2086, "cp866"},
- {2086, "csIBM866"},
- {2087, "IBM775"},
- {2087, "cp775"},
- {2087, "csPC775Baltic"},
- {2088, "KOI8-U"},
- {2088, "csKOI8U"},
- {2089, "IBM00858"},
- {2089, "CCSID00858"},
- {2089, "CP00858"},
- {2089, "PC-Multilingual-850+euro"},
- {2089, "csIBM00858"},
- {2090, "IBM00924"},
- {2090, "CCSID00924"},
- {2090, "CP00924"},
- {2090, "csIBM00924"},
- {2090, "ebcdic-Latin9--euro"},
- {2091, "IBM01140"},
- {2091, "CCSID01140"},
- {2091, "CP01140"},
- {2091, "csIBM01140"},
- {2091, "ebcdic-us-37+euro"},
- {2092, "IBM01141"},
- {2092, "CCSID01141"},
- {2092, "CP01141"},
- {2092, "csIBM01141"},
- {2092, "ebcdic-de-273+euro"},
- {2093, "IBM01142"},
- {2093, "CCSID01142"},
- {2093, "CP01142"},
- {2093, "csIBM01142"},
- {2093, "ebcdic-dk-277+euro"},
- {2093, "ebcdic-no-277+euro"},
- {2094, "IBM01143"},
- {2094, "CCSID01143"},
- {2094, "CP01143"},
- {2094, "csIBM01143"},
- {2094, "ebcdic-fi-278+euro"},
- {2094, "ebcdic-se-278+euro"},
- {2095, "IBM01144"},
- {2095, "CCSID01144"},
- {2095, "CP01144"},
- {2095, "csIBM01144"},
- {2095, "ebcdic-it-280+euro"},
- {2096, "IBM01145"},
- {2096, "CCSID01145"},
- {2096, "CP01145"},
- {2096, "csIBM01145"},
- {2096, "ebcdic-es-284+euro"},
- {2097, "IBM01146"},
- {2097, "CCSID01146"},
- {2097, "CP01146"},
- {2097, "csIBM01146"},
- {2097, "ebcdic-gb-285+euro"},
- {2098, "IBM01147"},
- {2098, "CCSID01147"},
- {2098, "CP01147"},
- {2098, "csIBM01147"},
- {2098, "ebcdic-fr-297+euro"},
- {2099, "IBM01148"},
- {2099, "CCSID01148"},
- {2099, "CP01148"},
- {2099, "csIBM01148"},
- {2099, "ebcdic-international-500+euro"},
- {2100, "IBM01149"},
- {2100, "CCSID01149"},
- {2100, "CP01149"},
- {2100, "csIBM01149"},
- {2100, "ebcdic-is-871+euro"},
- {2101, "Big5-HKSCS"},
- {2101, "csBig5HKSCS"},
- {2102, "IBM1047"},
- {2102, "IBM-1047"},
- {2102, "csIBM1047"},
- {2103, "PTCP154"},
- {2103, "CP154"},
- {2103, "Cyrillic-Asian"},
- {2103, "PT154"},
- {2103, "csPTCP154"},
- {2104, "Amiga-1251"},
- {2104, "Ami-1251"},
- {2104, "Ami1251"},
- {2104, "Amiga1251"},
- {2104, "csAmiga1251"},
- {2105, "KOI7-switched"},
- {2105, "csKOI7switched"},
- {2106, "BRF"},
- {2106, "csBRF"},
- {2107, "TSCII"},
- {2107, "csTSCII"},
- {2108, "CP51932"},
- {2108, "csCP51932"},
- {2109, "windows-874"},
- {2109, "cswindows874"},
- {2250, "windows-1250"},
- {2250, "cswindows1250"},
- {2251, "windows-1251"},
- {2251, "cswindows1251"},
- {2252, "windows-1252"},
- {2252, "cswindows1252"},
- {2253, "windows-1253"},
- {2253, "cswindows1253"},
- {2254, "windows-1254"},
- {2254, "cswindows1254"},
- {2255, "windows-1255"},
- {2255, "cswindows1255"},
- {2256, "windows-1256"},
- {2256, "cswindows1256"},
- {2257, "windows-1257"},
- {2257, "cswindows1257"},
- {2258, "windows-1258"},
- {2258, "cswindows1258"},
- {2259, "TIS-620"},
- {2259, "ISO-8859-11"},
- {2259, "csTIS620"},
- {2260, "CP50220"},
- {2260, "csCP50220"},
- {0, nullptr} // sentinel
+ {"", 1, 0},
+ {"", 2, 0},
+ {"US-ASCII", 3, 8},
+ {"iso-ir-6", 3, 8},
+ {"ANSI_X3.4-1968", 3, 14},
+ {"ANSI_X3.4-1986", 3, 14},
+ {"ISO_646.irv:1991", 3, 16},
+ {"ISO646-US", 3, 9},
+ {"us", 3, 2},
+ {"IBM367", 3, 6},
+ {"cp367", 3, 5},
+ {"csASCII", 3, 7},
+ {"ASCII", 3, 5},
+ {"ISO_8859-1:1987", 4, 15},
+ {"iso-ir-100", 4, 10},
+ {"ISO_8859-1", 4, 10},
+ {"ISO-8859-1", 4, 10},
+ {"latin1", 4, 6},
+ {"l1", 4, 2},
+ {"IBM819", 4, 6},
+ {"CP819", 4, 5},
+ {"csISOLatin1", 4, 11},
+ {"ISO_8859-2:1987", 5, 15},
+ {"iso-ir-101", 5, 10},
+ {"ISO_8859-2", 5, 10},
+ {"ISO-8859-2", 5, 10},
+ {"latin2", 5, 6},
+ {"l2", 5, 2},
+ {"csISOLatin2", 5, 11},
+ {"ISO_8859-3:1988", 6, 15},
+ {"iso-ir-109", 6, 10},
+ {"ISO_8859-3", 6, 10},
+ {"ISO-8859-3", 6, 10},
+ {"latin3", 6, 6},
+ {"l3", 6, 2},
+ {"csISOLatin3", 6, 11},
+ {"ISO_8859-4:1988", 7, 15},
+ {"iso-ir-110", 7, 10},
+ {"ISO_8859-4", 7, 10},
+ {"ISO-8859-4", 7, 10},
+ {"latin4", 7, 6},
+ {"l4", 7, 2},
+ {"csISOLatin4", 7, 11},
+ {"ISO_8859-5:1988", 8, 15},
+ {"iso-ir-144", 8, 10},
+ {"ISO_8859-5", 8, 10},
+ {"ISO-8859-5", 8, 10},
+ {"cyrillic", 8, 8},
+ {"csISOLatinCyrillic", 8, 18},
+ {"ISO_8859-6:1987", 9, 15},
+ {"iso-ir-127", 9, 10},
+ {"ISO_8859-6", 9, 10},
+ {"ISO-8859-6", 9, 10},
+ {"ECMA-114", 9, 8},
+ {"ASMO-708", 9, 8},
+ {"arabic", 9, 6},
+ {"csISOLatinArabic", 9, 16},
+ {"ISO_8859-7:1987", 10, 15},
+ {"iso-ir-126", 10, 10},
+ {"ISO_8859-7", 10, 10},
+ {"ISO-8859-7", 10, 10},
+ {"ELOT_928", 10, 8},
+ {"ECMA-118", 10, 8},
+ {"greek", 10, 5},
+ {"greek8", 10, 6},
+ {"csISOLatinGreek", 10, 15},
+ {"ISO_8859-8:1988", 11, 15},
+ {"iso-ir-138", 11, 10},
+ {"ISO_8859-8", 11, 10},
+ {"ISO-8859-8", 11, 10},
+ {"hebrew", 11, 6},
+ {"csISOLatinHebrew", 11, 16},
+ {"ISO_8859-9:1989", 12, 15},
+ {"iso-ir-148", 12, 10},
+ {"ISO_8859-9", 12, 10},
+ {"ISO-8859-9", 12, 10},
+ {"latin5", 12, 6},
+ {"l5", 12, 2},
+ {"csISOLatin5", 12, 11},
+ {"ISO-8859-10", 13, 11},
+ {"iso-ir-157", 13, 10},
+ {"l6", 13, 2},
+ {"ISO_8859-10:1992", 13, 16},
+ {"csISOLatin6", 13, 11},
+ {"latin6", 13, 6},
+ {"ISO_6937-2-add", 14, 14},
+ {"iso-ir-142", 14, 10},
+ {"csISOTextComm", 14, 13},
+ {"JIS_X0201", 15, 9},
+ {"X0201", 15, 5},
+ {"csHalfWidthKatakana", 15, 19},
+ {"JIS_Encoding", 16, 12},
+ {"csJISEncoding", 16, 13},
+ {"Shift_JIS", 17, 9},
+ {"MS_Kanji", 17, 8},
+ {"csShiftJIS", 17, 10},
+ {"Extended_UNIX_Code_Packed_Format_for_Japanese", 18, 45},
+ {"csEUCPkdFmtJapanese", 18, 19},
+ {"EUC-JP", 18, 6},
+ {"Extended_UNIX_Code_Fixed_Width_for_Japanese", 19, 43},
+ {"csEUCFixWidJapanese", 19, 19},
+ {"BS_4730", 20, 7},
+ {"iso-ir-4", 20, 8},
+ {"ISO646-GB", 20, 9},
+ {"gb", 20, 2},
+ {"uk", 20, 2},
+ {"csISO4UnitedKingdom", 20, 19},
+ {"SEN_850200_C", 21, 12},
+ {"iso-ir-11", 21, 9},
+ {"ISO646-SE2", 21, 10},
+ {"se2", 21, 3},
+ {"csISO11SwedishForNames", 21, 22},
+ {"IT", 22, 2},
+ {"iso-ir-15", 22, 9},
+ {"ISO646-IT", 22, 9},
+ {"csISO15Italian", 22, 14},
+ {"ES", 23, 2},
+ {"iso-ir-17", 23, 9},
+ {"ISO646-ES", 23, 9},
+ {"csISO17Spanish", 23, 14},
+ {"DIN_66003", 24, 9},
+ {"iso-ir-21", 24, 9},
+ {"de", 24, 2},
+ {"ISO646-DE", 24, 9},
+ {"csISO21German", 24, 13},
+ {"NS_4551-1", 25, 9},
+ {"iso-ir-60", 25, 9},
+ {"ISO646-NO", 25, 9},
+ {"no", 25, 2},
+ {"csISO60DanishNorwegian", 25, 22},
+ {"csISO60Norwegian1", 25, 17},
+ {"NF_Z_62-010", 26, 11},
+ {"iso-ir-69", 26, 9},
+ {"ISO646-FR", 26, 9},
+ {"fr", 26, 2},
+ {"csISO69French", 26, 13},
+ {"ISO-10646-UTF-1", 27, 15},
+ {"csISO10646UTF1", 27, 14},
+ {"ISO_646.basic:1983", 28, 18},
+ {"ref", 28, 3},
+ {"csISO646basic1983", 28, 17},
+ {"INVARIANT", 29, 9},
+ {"csINVARIANT", 29, 11},
+ {"ISO_646.irv:1983", 30, 16},
+ {"iso-ir-2", 30, 8},
+ {"irv", 30, 3},
+ {"csISO2IntlRefVersion", 30, 20},
+ {"NATS-SEFI", 31, 9},
+ {"iso-ir-8-1", 31, 10},
+ {"csNATSSEFI", 31, 10},
+ {"NATS-SEFI-ADD", 32, 13},
+ {"iso-ir-8-2", 32, 10},
+ {"csNATSSEFIADD", 32, 13},
+ {"SEN_850200_B", 35, 12},
+ {"iso-ir-10", 35, 9},
+ {"FI", 35, 2},
+ {"ISO646-FI", 35, 9},
+ {"ISO646-SE", 35, 9},
+ {"se", 35, 2},
+ {"csISO10Swedish", 35, 14},
+ {"KS_C_5601-1987", 36, 14},
+ {"iso-ir-149", 36, 10},
+ {"KS_C_5601-1989", 36, 14},
+ {"KSC_5601", 36, 8},
+ {"korean", 36, 6},
+ {"csKSC56011987", 36, 13},
+ {"ISO-2022-KR", 37, 11},
+ {"csISO2022KR", 37, 11},
+ {"EUC-KR", 38, 6},
+ {"csEUCKR", 38, 7},
+ {"ISO-2022-JP", 39, 11},
+ {"csISO2022JP", 39, 11},
+ {"ISO-2022-JP-2", 40, 13},
+ {"csISO2022JP2", 40, 12},
+ {"JIS_C6220-1969-jp", 41, 17},
+ {"JIS_C6220-1969", 41, 14},
+ {"iso-ir-13", 41, 9},
+ {"katakana", 41, 8},
+ {"x0201-7", 41, 7},
+ {"csISO13JISC6220jp", 41, 17},
+ {"JIS_C6220-1969-ro", 42, 17},
+ {"iso-ir-14", 42, 9},
+ {"jp", 42, 2},
+ {"ISO646-JP", 42, 9},
+ {"csISO14JISC6220ro", 42, 17},
+ {"PT", 43, 2},
+ {"iso-ir-16", 43, 9},
+ {"ISO646-PT", 43, 9},
+ {"csISO16Portuguese", 43, 17},
+ {"greek7-old", 44, 10},
+ {"iso-ir-18", 44, 9},
+ {"csISO18Greek7Old", 44, 16},
+ {"latin-greek", 45, 11},
+ {"iso-ir-19", 45, 9},
+ {"csISO19LatinGreek", 45, 17},
+ {"NF_Z_62-010_(1973)", 46, 18},
+ {"iso-ir-25", 46, 9},
+ {"ISO646-FR1", 46, 10},
+ {"csISO25French", 46, 13},
+ {"Latin-greek-1", 47, 13},
+ {"iso-ir-27", 47, 9},
+ {"csISO27LatinGreek1", 47, 18},
+ {"ISO_5427", 48, 8},
+ {"iso-ir-37", 48, 9},
+ {"csISO5427Cyrillic", 48, 17},
+ {"JIS_C6226-1978", 49, 14},
+ {"iso-ir-42", 49, 9},
+ {"csISO42JISC62261978", 49, 19},
+ {"BS_viewdata", 50, 11},
+ {"iso-ir-47", 50, 9},
+ {"csISO47BSViewdata", 50, 17},
+ {"INIS", 51, 4},
+ {"iso-ir-49", 51, 9},
+ {"csISO49INIS", 51, 11},
+ {"INIS-8", 52, 6},
+ {"iso-ir-50", 52, 9},
+ {"csISO50INIS8", 52, 12},
+ {"INIS-cyrillic", 53, 13},
+ {"iso-ir-51", 53, 9},
+ {"csISO51INISCyrillic", 53, 19},
+ {"ISO_5427:1981", 54, 13},
+ {"iso-ir-54", 54, 9},
+ {"ISO5427Cyrillic1981", 54, 19},
+ {"csISO54271981", 54, 13},
+ {"ISO_5428:1980", 55, 13},
+ {"iso-ir-55", 55, 9},
+ {"csISO5428Greek", 55, 14},
+ {"GB_1988-80", 56, 10},
+ {"iso-ir-57", 56, 9},
+ {"cn", 56, 2},
+ {"ISO646-CN", 56, 9},
+ {"csISO57GB1988", 56, 13},
+ {"GB_2312-80", 57, 10},
+ {"iso-ir-58", 57, 9},
+ {"chinese", 57, 7},
+ {"csISO58GB231280", 57, 15},
+ {"NS_4551-2", 58, 9},
+ {"ISO646-NO2", 58, 10},
+ {"iso-ir-61", 58, 9},
+ {"no2", 58, 3},
+ {"csISO61Norwegian2", 58, 17},
+ {"videotex-suppl", 59, 14},
+ {"iso-ir-70", 59, 9},
+ {"csISO70VideotexSupp1", 59, 20},
+ {"PT2", 60, 3},
+ {"iso-ir-84", 60, 9},
+ {"ISO646-PT2", 60, 10},
+ {"csISO84Portuguese2", 60, 18},
+ {"ES2", 61, 3},
+ {"iso-ir-85", 61, 9},
+ {"ISO646-ES2", 61, 10},
+ {"csISO85Spanish2", 61, 15},
+ {"MSZ_7795.3", 62, 10},
+ {"iso-ir-86", 62, 9},
+ {"ISO646-HU", 62, 9},
+ {"hu", 62, 2},
+ {"csISO86Hungarian", 62, 16},
+ {"JIS_C6226-1983", 63, 14},
+ {"iso-ir-87", 63, 9},
+ {"x0208", 63, 5},
+ {"JIS_X0208-1983", 63, 14},
+ {"csISO87JISX0208", 63, 15},
+ {"greek7", 64, 6},
+ {"iso-ir-88", 64, 9},
+ {"csISO88Greek7", 64, 13},
+ {"ASMO_449", 65, 8},
+ {"ISO_9036", 65, 8},
+ {"arabic7", 65, 7},
+ {"iso-ir-89", 65, 9},
+ {"csISO89ASMO449", 65, 14},
+ {"iso-ir-90", 66, 9},
+ {"csISO90", 66, 7},
+ {"JIS_C6229-1984-a", 67, 16},
+ {"iso-ir-91", 67, 9},
+ {"jp-ocr-a", 67, 8},
+ {"csISO91JISC62291984a", 67, 20},
+ {"JIS_C6229-1984-b", 68, 16},
+ {"iso-ir-92", 68, 9},
+ {"ISO646-JP-OCR-B", 68, 15},
+ {"jp-ocr-b", 68, 8},
+ {"csISO92JISC62991984b", 68, 20},
+ {"JIS_C6229-1984-b-add", 69, 20},
+ {"iso-ir-93", 69, 9},
+ {"jp-ocr-b-add", 69, 12},
+ {"csISO93JIS62291984badd", 69, 22},
+ {"JIS_C6229-1984-hand", 70, 19},
+ {"iso-ir-94", 70, 9},
+ {"jp-ocr-hand", 70, 11},
+ {"csISO94JIS62291984hand", 70, 22},
+ {"JIS_C6229-1984-hand-add", 71, 23},
+ {"iso-ir-95", 71, 9},
+ {"jp-ocr-hand-add", 71, 15},
+ {"csISO95JIS62291984handadd", 71, 25},
+ {"JIS_C6229-1984-kana", 72, 19},
+ {"iso-ir-96", 72, 9},
+ {"csISO96JISC62291984kana", 72, 23},
+ {"ISO_2033-1983", 73, 13},
+ {"iso-ir-98", 73, 9},
+ {"e13b", 73, 4},
+ {"csISO2033", 73, 9},
+ {"ANSI_X3.110-1983", 74, 16},
+ {"iso-ir-99", 74, 9},
+ {"CSA_T500-1983", 74, 13},
+ {"NAPLPS", 74, 6},
+ {"csISO99NAPLPS", 74, 13},
+ {"T.61-7bit", 75, 9},
+ {"iso-ir-102", 75, 10},
+ {"csISO102T617bit", 75, 15},
+ {"T.61-8bit", 76, 9},
+ {"T.61", 76, 4},
+ {"iso-ir-103", 76, 10},
+ {"csISO103T618bit", 76, 15},
+ {"ECMA-cyrillic", 77, 13},
+ {"iso-ir-111", 77, 10},
+ {"KOI8-E", 77, 6},
+ {"csISO111ECMACyrillic", 77, 20},
+ {"CSA_Z243.4-1985-1", 78, 17},
+ {"iso-ir-121", 78, 10},
+ {"ISO646-CA", 78, 9},
+ {"csa7-1", 78, 6},
+ {"csa71", 78, 5},
+ {"ca", 78, 2},
+ {"csISO121Canadian1", 78, 17},
+ {"CSA_Z243.4-1985-2", 79, 17},
+ {"iso-ir-122", 79, 10},
+ {"ISO646-CA2", 79, 10},
+ {"csa7-2", 79, 6},
+ {"csa72", 79, 5},
+ {"csISO122Canadian2", 79, 17},
+ {"CSA_Z243.4-1985-gr", 80, 18},
+ {"iso-ir-123", 80, 10},
+ {"csISO123CSAZ24341985gr", 80, 22},
+ {"ISO_8859-6-E", 81, 12},
+ {"csISO88596E", 81, 11},
+ {"ISO-8859-6-E", 81, 12},
+ {"ISO_8859-6-I", 82, 12},
+ {"csISO88596I", 82, 11},
+ {"ISO-8859-6-I", 82, 12},
+ {"T.101-G2", 83, 8},
+ {"iso-ir-128", 83, 10},
+ {"csISO128T101G2", 83, 14},
+ {"ISO_8859-8-E", 84, 12},
+ {"csISO88598E", 84, 11},
+ {"ISO-8859-8-E", 84, 12},
+ {"ISO_8859-8-I", 85, 12},
+ {"csISO88598I", 85, 11},
+ {"ISO-8859-8-I", 85, 12},
+ {"CSN_369103", 86, 10},
+ {"iso-ir-139", 86, 10},
+ {"csISO139CSN369103", 86, 17},
+ {"JUS_I.B1.002", 87, 12},
+ {"iso-ir-141", 87, 10},
+ {"ISO646-YU", 87, 9},
+ {"js", 87, 2},
+ {"yu", 87, 2},
+ {"csISO141JUSIB1002", 87, 17},
+ {"IEC_P27-1", 88, 9},
+ {"iso-ir-143", 88, 10},
+ {"csISO143IECP271", 88, 15},
+ {"JUS_I.B1.003-serb", 89, 17},
+ {"iso-ir-146", 89, 10},
+ {"serbian", 89, 7},
+ {"csISO146Serbian", 89, 15},
+ {"JUS_I.B1.003-mac", 90, 16},
+ {"macedonian", 90, 10},
+ {"iso-ir-147", 90, 10},
+ {"csISO147Macedonian", 90, 18},
+ {"greek-ccitt", 91, 11},
+ {"iso-ir-150", 91, 10},
+ {"csISO150", 91, 8},
+ {"csISO150GreekCCITT", 91, 18},
+ {"NC_NC00-10:81", 92, 13},
+ {"cuba", 92, 4},
+ {"iso-ir-151", 92, 10},
+ {"ISO646-CU", 92, 9},
+ {"csISO151Cuba", 92, 12},
+ {"ISO_6937-2-25", 93, 13},
+ {"iso-ir-152", 93, 10},
+ {"csISO6937Add", 93, 12},
+ {"GOST_19768-74", 94, 13},
+ {"ST_SEV_358-88", 94, 13},
+ {"iso-ir-153", 94, 10},
+ {"csISO153GOST1976874", 94, 19},
+ {"ISO_8859-supp", 95, 13},
+ {"iso-ir-154", 95, 10},
+ {"latin1-2-5", 95, 10},
+ {"csISO8859Supp", 95, 13},
+ {"ISO_10367-box", 96, 13},
+ {"iso-ir-155", 96, 10},
+ {"csISO10367Box", 96, 13},
+ {"latin-lap", 97, 9},
+ {"lap", 97, 3},
+ {"iso-ir-158", 97, 10},
+ {"csISO158Lap", 97, 11},
+ {"JIS_X0212-1990", 98, 14},
+ {"x0212", 98, 5},
+ {"iso-ir-159", 98, 10},
+ {"csISO159JISX02121990", 98, 20},
+ {"DS_2089", 99, 7},
+ {"DS2089", 99, 6},
+ {"ISO646-DK", 99, 9},
+ {"dk", 99, 2},
+ {"csISO646Danish", 99, 14},
+ {"us-dk", 100, 5},
+ {"csUSDK", 100, 6},
+ {"dk-us", 101, 5},
+ {"csDKUS", 101, 6},
+ {"KSC5636", 102, 7},
+ {"ISO646-KR", 102, 9},
+ {"csKSC5636", 102, 9},
+ {"UNICODE-1-1-UTF-7", 103, 17},
+ {"csUnicode11UTF7", 103, 15},
+ {"ISO-2022-CN", 104, 11},
+ {"csISO2022CN", 104, 11},
+ {"ISO-2022-CN-EXT", 105, 15},
+ {"csISO2022CNEXT", 105, 14},
+ {"UTF-8", 106, 5},
+ {"csUTF8", 106, 6},
+ {"ISO-8859-13", 109, 11},
+ {"csISO885913", 109, 11},
+ {"ISO-8859-14", 110, 11},
+ {"iso-ir-199", 110, 10},
+ {"ISO_8859-14:1998", 110, 16},
+ {"ISO_8859-14", 110, 11},
+ {"latin8", 110, 6},
+ {"iso-celtic", 110, 10},
+ {"l8", 110, 2},
+ {"csISO885914", 110, 11},
+ {"ISO-8859-15", 111, 11},
+ {"ISO_8859-15", 111, 11},
+ {"Latin-9", 111, 7},
+ {"csISO885915", 111, 11},
+ {"ISO-8859-16", 112, 11},
+ {"iso-ir-226", 112, 10},
+ {"ISO_8859-16:2001", 112, 16},
+ {"ISO_8859-16", 112, 11},
+ {"latin10", 112, 7},
+ {"l10", 112, 3},
+ {"csISO885916", 112, 11},
+ {"GBK", 113, 3},
+ {"CP936", 113, 5},
+ {"MS936", 113, 5},
+ {"windows-936", 113, 11},
+ {"csGBK", 113, 5},
+ {"GB18030", 114, 7},
+ {"csGB18030", 114, 9},
+ {"OSD_EBCDIC_DF04_15", 115, 18},
+ {"csOSDEBCDICDF0415", 115, 17},
+ {"OSD_EBCDIC_DF03_IRV", 116, 19},
+ {"csOSDEBCDICDF03IRV", 116, 18},
+ {"OSD_EBCDIC_DF04_1", 117, 17},
+ {"csOSDEBCDICDF041", 117, 16},
+ {"ISO-11548-1", 118, 11},
+ {"ISO_11548-1", 118, 11},
+ {"ISO_TR_11548-1", 118, 14},
+ {"csISO115481", 118, 11},
+ {"KZ-1048", 119, 7},
+ {"STRK1048-2002", 119, 13},
+ {"RK1048", 119, 6},
+ {"csKZ1048", 119, 8},
+ {"ISO-10646-UCS-2", 1000, 15},
+ {"csUnicode", 1000, 9},
+ {"ISO-10646-UCS-4", 1001, 15},
+ {"csUCS4", 1001, 6},
+ {"ISO-10646-UCS-Basic", 1002, 19},
+ {"csUnicodeASCII", 1002, 14},
+ {"ISO-10646-Unicode-Latin1", 1003, 24},
+ {"csUnicodeLatin1", 1003, 15},
+ {"ISO-10646", 1003, 9},
+ {"ISO-10646-J-1", 1004, 13},
+ {"csUnicodeJapanese", 1004, 17},
+ {"ISO-Unicode-IBM-1261", 1005, 20},
+ {"csUnicodeIBM1261", 1005, 16},
+ {"ISO-Unicode-IBM-1268", 1006, 20},
+ {"csUnicodeIBM1268", 1006, 16},
+ {"ISO-Unicode-IBM-1276", 1007, 20},
+ {"csUnicodeIBM1276", 1007, 16},
+ {"ISO-Unicode-IBM-1264", 1008, 20},
+ {"csUnicodeIBM1264", 1008, 16},
+ {"ISO-Unicode-IBM-1265", 1009, 20},
+ {"csUnicodeIBM1265", 1009, 16},
+ {"UNICODE-1-1", 1010, 11},
+ {"csUnicode11", 1010, 11},
+ {"SCSU", 1011, 4},
+ {"csSCSU", 1011, 6},
+ {"UTF-7", 1012, 5},
+ {"csUTF7", 1012, 6},
+ {"UTF-16BE", 1013, 8},
+ {"csUTF16BE", 1013, 9},
+ {"UTF-16LE", 1014, 8},
+ {"csUTF16LE", 1014, 9},
+ {"UTF-16", 1015, 6},
+ {"csUTF16", 1015, 7},
+ {"CESU-8", 1016, 6},
+ {"csCESU8", 1016, 7},
+ {"csCESU-8", 1016, 8},
+ {"UTF-32", 1017, 6},
+ {"csUTF32", 1017, 7},
+ {"UTF-32BE", 1018, 8},
+ {"csUTF32BE", 1018, 9},
+ {"UTF-32LE", 1019, 8},
+ {"csUTF32LE", 1019, 9},
+ {"BOCU-1", 1020, 6},
+ {"csBOCU1", 1020, 7},
+ {"csBOCU-1", 1020, 8},
+ {"UTF-7-IMAP", 1021, 10},
+ {"csUTF7IMAP", 1021, 10},
+ {"ISO-8859-1-Windows-3.0-Latin-1", 2000, 30},
+ {"csWindows30Latin1", 2000, 17},
+ {"ISO-8859-1-Windows-3.1-Latin-1", 2001, 30},
+ {"csWindows31Latin1", 2001, 17},
+ {"ISO-8859-2-Windows-Latin-2", 2002, 26},
+ {"csWindows31Latin2", 2002, 17},
+ {"ISO-8859-9-Windows-Latin-5", 2003, 26},
+ {"csWindows31Latin5", 2003, 17},
+ {"hp-roman8", 2004, 9},
+ {"roman8", 2004, 6},
+ {"r8", 2004, 2},
+ {"csHPRoman8", 2004, 10},
+ {"Adobe-Standard-Encoding", 2005, 23},
+ {"csAdobeStandardEncoding", 2005, 23},
+ {"Ventura-US", 2006, 10},
+ {"csVenturaUS", 2006, 11},
+ {"Ventura-International", 2007, 21},
+ {"csVenturaInternational", 2007, 22},
+ {"DEC-MCS", 2008, 7},
+ {"dec", 2008, 3},
+ {"csDECMCS", 2008, 8},
+ {"IBM850", 2009, 6},
+ {"cp850", 2009, 5},
+ {"850", 2009, 3},
+ {"csPC850Multilingual", 2009, 19},
+ {"IBM852", 2010, 6},
+ {"cp852", 2010, 5},
+ {"852", 2010, 3},
+ {"csPCp852", 2010, 8},
+ {"IBM437", 2011, 6},
+ {"cp437", 2011, 5},
+ {"437", 2011, 3},
+ {"csPC8CodePage437", 2011, 16},
+ {"PC8-Danish-Norwegian", 2012, 20},
+ {"csPC8DanishNorwegian", 2012, 20},
+ {"IBM862", 2013, 6},
+ {"cp862", 2013, 5},
+ {"862", 2013, 3},
+ {"csPC862LatinHebrew", 2013, 18},
+ {"PC8-Turkish", 2014, 11},
+ {"csPC8Turkish", 2014, 12},
+ {"IBM-Symbols", 2015, 11},
+ {"csIBMSymbols", 2015, 12},
+ {"IBM-Thai", 2016, 8},
+ {"csIBMThai", 2016, 9},
+ {"HP-Legal", 2017, 8},
+ {"csHPLegal", 2017, 9},
+ {"HP-Pi-font", 2018, 10},
+ {"csHPPiFont", 2018, 10},
+ {"HP-Math8", 2019, 8},
+ {"csHPMath8", 2019, 9},
+ {"Adobe-Symbol-Encoding", 2020, 21},
+ {"csHPPSMath", 2020, 10},
+ {"HP-DeskTop", 2021, 10},
+ {"csHPDesktop", 2021, 11},
+ {"Ventura-Math", 2022, 12},
+ {"csVenturaMath", 2022, 13},
+ {"Microsoft-Publishing", 2023, 20},
+ {"csMicrosoftPublishing", 2023, 21},
+ {"Windows-31J", 2024, 11},
+ {"csWindows31J", 2024, 12},
+ {"GB2312", 2025, 6},
+ {"csGB2312", 2025, 8},
+ {"Big5", 2026, 4},
+ {"csBig5", 2026, 6},
+ {"macintosh", 2027, 9},
+ {"mac", 2027, 3},
+ {"csMacintosh", 2027, 11},
+ {"IBM037", 2028, 6},
+ {"cp037", 2028, 5},
+ {"ebcdic-cp-us", 2028, 12},
+ {"ebcdic-cp-ca", 2028, 12},
+ {"ebcdic-cp-wt", 2028, 12},
+ {"ebcdic-cp-nl", 2028, 12},
+ {"csIBM037", 2028, 8},
+ {"IBM038", 2029, 6},
+ {"EBCDIC-INT", 2029, 10},
+ {"cp038", 2029, 5},
+ {"csIBM038", 2029, 8},
+ {"IBM273", 2030, 6},
+ {"CP273", 2030, 5},
+ {"csIBM273", 2030, 8},
+ {"IBM274", 2031, 6},
+ {"EBCDIC-BE", 2031, 9},
+ {"CP274", 2031, 5},
+ {"csIBM274", 2031, 8},
+ {"IBM275", 2032, 6},
+ {"EBCDIC-BR", 2032, 9},
+ {"cp275", 2032, 5},
+ {"csIBM275", 2032, 8},
+ {"IBM277", 2033, 6},
+ {"EBCDIC-CP-DK", 2033, 12},
+ {"EBCDIC-CP-NO", 2033, 12},
+ {"csIBM277", 2033, 8},
+ {"IBM278", 2034, 6},
+ {"CP278", 2034, 5},
+ {"ebcdic-cp-fi", 2034, 12},
+ {"ebcdic-cp-se", 2034, 12},
+ {"csIBM278", 2034, 8},
+ {"IBM280", 2035, 6},
+ {"CP280", 2035, 5},
+ {"ebcdic-cp-it", 2035, 12},
+ {"csIBM280", 2035, 8},
+ {"IBM281", 2036, 6},
+ {"EBCDIC-JP-E", 2036, 11},
+ {"cp281", 2036, 5},
+ {"csIBM281", 2036, 8},
+ {"IBM284", 2037, 6},
+ {"CP284", 2037, 5},
+ {"ebcdic-cp-es", 2037, 12},
+ {"csIBM284", 2037, 8},
+ {"IBM285", 2038, 6},
+ {"CP285", 2038, 5},
+ {"ebcdic-cp-gb", 2038, 12},
+ {"csIBM285", 2038, 8},
+ {"IBM290", 2039, 6},
+ {"cp290", 2039, 5},
+ {"EBCDIC-JP-kana", 2039, 14},
+ {"csIBM290", 2039, 8},
+ {"IBM297", 2040, 6},
+ {"cp297", 2040, 5},
+ {"ebcdic-cp-fr", 2040, 12},
+ {"csIBM297", 2040, 8},
+ {"IBM420", 2041, 6},
+ {"cp420", 2041, 5},
+ {"ebcdic-cp-ar1", 2041, 13},
+ {"csIBM420", 2041, 8},
+ {"IBM423", 2042, 6},
+ {"cp423", 2042, 5},
+ {"ebcdic-cp-gr", 2042, 12},
+ {"csIBM423", 2042, 8},
+ {"IBM424", 2043, 6},
+ {"cp424", 2043, 5},
+ {"ebcdic-cp-he", 2043, 12},
+ {"csIBM424", 2043, 8},
+ {"IBM500", 2044, 6},
+ {"CP500", 2044, 5},
+ {"ebcdic-cp-be", 2044, 12},
+ {"ebcdic-cp-ch", 2044, 12},
+ {"csIBM500", 2044, 8},
+ {"IBM851", 2045, 6},
+ {"cp851", 2045, 5},
+ {"851", 2045, 3},
+ {"csIBM851", 2045, 8},
+ {"IBM855", 2046, 6},
+ {"cp855", 2046, 5},
+ {"855", 2046, 3},
+ {"csIBM855", 2046, 8},
+ {"IBM857", 2047, 6},
+ {"cp857", 2047, 5},
+ {"857", 2047, 3},
+ {"csIBM857", 2047, 8},
+ {"IBM860", 2048, 6},
+ {"cp860", 2048, 5},
+ {"860", 2048, 3},
+ {"csIBM860", 2048, 8},
+ {"IBM861", 2049, 6},
+ {"cp861", 2049, 5},
+ {"861", 2049, 3},
+ {"cp-is", 2049, 5},
+ {"csIBM861", 2049, 8},
+ {"IBM863", 2050, 6},
+ {"cp863", 2050, 5},
+ {"863", 2050, 3},
+ {"csIBM863", 2050, 8},
+ {"IBM864", 2051, 6},
+ {"cp864", 2051, 5},
+ {"csIBM864", 2051, 8},
+ {"IBM865", 2052, 6},
+ {"cp865", 2052, 5},
+ {"865", 2052, 3},
+ {"csIBM865", 2052, 8},
+ {"IBM868", 2053, 6},
+ {"CP868", 2053, 5},
+ {"cp-ar", 2053, 5},
+ {"csIBM868", 2053, 8},
+ {"IBM869", 2054, 6},
+ {"cp869", 2054, 5},
+ {"869", 2054, 3},
+ {"cp-gr", 2054, 5},
+ {"csIBM869", 2054, 8},
+ {"IBM870", 2055, 6},
+ {"CP870", 2055, 5},
+ {"ebcdic-cp-roece", 2055, 15},
+ {"ebcdic-cp-yu", 2055, 12},
+ {"csIBM870", 2055, 8},
+ {"IBM871", 2056, 6},
+ {"CP871", 2056, 5},
+ {"ebcdic-cp-is", 2056, 12},
+ {"csIBM871", 2056, 8},
+ {"IBM880", 2057, 6},
+ {"cp880", 2057, 5},
+ {"EBCDIC-Cyrillic", 2057, 15},
+ {"csIBM880", 2057, 8},
+ {"IBM891", 2058, 6},
+ {"cp891", 2058, 5},
+ {"csIBM891", 2058, 8},
+ {"IBM903", 2059, 6},
+ {"cp903", 2059, 5},
+ {"csIBM903", 2059, 8},
+ {"IBM904", 2060, 6},
+ {"cp904", 2060, 5},
+ {"904", 2060, 3},
+ {"csIBBM904", 2060, 9},
+ {"IBM905", 2061, 6},
+ {"CP905", 2061, 5},
+ {"ebcdic-cp-tr", 2061, 12},
+ {"csIBM905", 2061, 8},
+ {"IBM918", 2062, 6},
+ {"CP918", 2062, 5},
+ {"ebcdic-cp-ar2", 2062, 13},
+ {"csIBM918", 2062, 8},
+ {"IBM1026", 2063, 7},
+ {"CP1026", 2063, 6},
+ {"csIBM1026", 2063, 9},
+ {"EBCDIC-AT-DE", 2064, 12},
+ {"csIBMEBCDICATDE", 2064, 15},
+ {"EBCDIC-AT-DE-A", 2065, 14},
+ {"csEBCDICATDEA", 2065, 13},
+ {"EBCDIC-CA-FR", 2066, 12},
+ {"csEBCDICCAFR", 2066, 12},
+ {"EBCDIC-DK-NO", 2067, 12},
+ {"csEBCDICDKNO", 2067, 12},
+ {"EBCDIC-DK-NO-A", 2068, 14},
+ {"csEBCDICDKNOA", 2068, 13},
+ {"EBCDIC-FI-SE", 2069, 12},
+ {"csEBCDICFISE", 2069, 12},
+ {"EBCDIC-FI-SE-A", 2070, 14},
+ {"csEBCDICFISEA", 2070, 13},
+ {"EBCDIC-FR", 2071, 9},
+ {"csEBCDICFR", 2071, 10},
+ {"EBCDIC-IT", 2072, 9},
+ {"csEBCDICIT", 2072, 10},
+ {"EBCDIC-PT", 2073, 9},
+ {"csEBCDICPT", 2073, 10},
+ {"EBCDIC-ES", 2074, 9},
+ {"csEBCDICES", 2074, 10},
+ {"EBCDIC-ES-A", 2075, 11},
+ {"csEBCDICESA", 2075, 11},
+ {"EBCDIC-ES-S", 2076, 11},
+ {"csEBCDICESS", 2076, 11},
+ {"EBCDIC-UK", 2077, 9},
+ {"csEBCDICUK", 2077, 10},
+ {"EBCDIC-US", 2078, 9},
+ {"csEBCDICUS", 2078, 10},
+ {"UNKNOWN-8BIT", 2079, 12},
+ {"csUnknown8BiT", 2079, 13},
+ {"MNEMONIC", 2080, 8},
+ {"csMnemonic", 2080, 10},
+ {"MNEM", 2081, 4},
+ {"csMnem", 2081, 6},
+ {"VISCII", 2082, 6},
+ {"csVISCII", 2082, 8},
+ {"VIQR", 2083, 4},
+ {"csVIQR", 2083, 6},
+ {"KOI8-R", 2084, 6},
+ {"csKOI8R", 2084, 7},
+ {"HZ-GB-2312", 2085, 10},
+ {"IBM866", 2086, 6},
+ {"cp866", 2086, 5},
+ {"866", 2086, 3},
+ {"csIBM866", 2086, 8},
+ {"IBM775", 2087, 6},
+ {"cp775", 2087, 5},
+ {"csPC775Baltic", 2087, 13},
+ {"KOI8-U", 2088, 6},
+ {"csKOI8U", 2088, 7},
+ {"IBM00858", 2089, 8},
+ {"CCSID00858", 2089, 10},
+ {"CP00858", 2089, 7},
+ {"PC-Multilingual-850+euro", 2089, 24},
+ {"csIBM00858", 2089, 10},
+ {"IBM00924", 2090, 8},
+ {"CCSID00924", 2090, 10},
+ {"CP00924", 2090, 7},
+ {"ebcdic-Latin9--euro", 2090, 19},
+ {"csIBM00924", 2090, 10},
+ {"IBM01140", 2091, 8},
+ {"CCSID01140", 2091, 10},
+ {"CP01140", 2091, 7},
+ {"ebcdic-us-37+euro", 2091, 17},
+ {"csIBM01140", 2091, 10},
+ {"IBM01141", 2092, 8},
+ {"CCSID01141", 2092, 10},
+ {"CP01141", 2092, 7},
+ {"ebcdic-de-273+euro", 2092, 18},
+ {"csIBM01141", 2092, 10},
+ {"IBM01142", 2093, 8},
+ {"CCSID01142", 2093, 10},
+ {"CP01142", 2093, 7},
+ {"ebcdic-dk-277+euro", 2093, 18},
+ {"ebcdic-no-277+euro", 2093, 18},
+ {"csIBM01142", 2093, 10},
+ {"IBM01143", 2094, 8},
+ {"CCSID01143", 2094, 10},
+ {"CP01143", 2094, 7},
+ {"ebcdic-fi-278+euro", 2094, 18},
+ {"ebcdic-se-278+euro", 2094, 18},
+ {"csIBM01143", 2094, 10},
+ {"IBM01144", 2095, 8},
+ {"CCSID01144", 2095, 10},
+ {"CP01144", 2095, 7},
+ {"ebcdic-it-280+euro", 2095, 18},
+ {"csIBM01144", 2095, 10},
+ {"IBM01145", 2096, 8},
+ {"CCSID01145", 2096, 10},
+ {"CP01145", 2096, 7},
+ {"ebcdic-es-284+euro", 2096, 18},
+ {"csIBM01145", 2096, 10},
+ {"IBM01146", 2097, 8},
+ {"CCSID01146", 2097, 10},
+ {"CP01146", 2097, 7},
+ {"ebcdic-gb-285+euro", 2097, 18},
+ {"csIBM01146", 2097, 10},
+ {"IBM01147", 2098, 8},
+ {"CCSID01147", 2098, 10},
+ {"CP01147", 2098, 7},
+ {"ebcdic-fr-297+euro", 2098, 18},
+ {"csIBM01147", 2098, 10},
+ {"IBM01148", 2099, 8},
+ {"CCSID01148", 2099, 10},
+ {"CP01148", 2099, 7},
+ {"ebcdic-international-500+euro", 2099, 29},
+ {"csIBM01148", 2099, 10},
+ {"IBM01149", 2100, 8},
+ {"CCSID01149", 2100, 10},
+ {"CP01149", 2100, 7},
+ {"ebcdic-is-871+euro", 2100, 18},
+ {"csIBM01149", 2100, 10},
+ {"Big5-HKSCS", 2101, 10},
+ {"csBig5HKSCS", 2101, 11},
+ {"IBM1047", 2102, 7},
+ {"IBM-1047", 2102, 8},
+ {"csIBM1047", 2102, 9},
+ {"PTCP154", 2103, 7},
+ {"csPTCP154", 2103, 9},
+ {"PT154", 2103, 5},
+ {"CP154", 2103, 5},
+ {"Cyrillic-Asian", 2103, 14},
+ {"Amiga-1251", 2104, 10},
+ {"Ami1251", 2104, 7},
+ {"Amiga1251", 2104, 9},
+ {"Ami-1251", 2104, 8},
+ {"csAmiga1251", 2104, 11},
+ {"KOI7-switched", 2105, 13},
+ {"csKOI7switched", 2105, 14},
+ {"BRF", 2106, 3},
+ {"csBRF", 2106, 5},
+ {"TSCII", 2107, 5},
+ {"csTSCII", 2107, 7},
+ {"CP51932", 2108, 7},
+ {"csCP51932", 2108, 9},
+ {"windows-874", 2109, 11},
+ {"cswindows874", 2109, 12},
+ {"windows-1250", 2250, 12},
+ {"cswindows1250", 2250, 13},
+ {"windows-1251", 2251, 12},
+ {"cswindows1251", 2251, 13},
+ {"windows-1252", 2252, 12},
+ {"cswindows1252", 2252, 13},
+ {"windows-1253", 2253, 12},
+ {"cswindows1253", 2253, 13},
+ {"windows-1254", 2254, 12},
+ {"cswindows1254", 2254, 13},
+ {"windows-1255", 2255, 12},
+ {"cswindows1255", 2255, 13},
+ {"windows-1256", 2256, 12},
+ {"cswindows1256", 2256, 13},
+ {"windows-1257", 2257, 12},
+ {"cswindows1257", 2257, 13},
+ {"windows-1258", 2258, 12},
+ {"cswindows1258", 2258, 13},
+ {"TIS-620", 2259, 7},
+ {"csTIS620", 2259, 8},
+ {"ISO-8859-11", 2259, 11},
+ {"CP50220", 2260, 7},
+ {"csCP50220", 2260, 9},
};
const __encoding_data* __encoding_rep_ = __text_encoding_data + 1;
@@ -1465,12 +1459,8 @@ struct hash<text_encoding> {
size_t operator()(const text_encoding& __enc) const noexcept { return std::hash<text_encoding::id>()(__enc.mib()); }
};
-namespace ranges {
-
template <>
-inline constexpr bool enable_borrowed_range<text_encoding::aliases_view> = true;
-
-} // namespace ranges
+inline constexpr bool ranges::enable_borrowed_range<text_encoding::aliases_view> = true;
_LIBCPP_END_NAMESPACE_STD
@@ -1478,6 +1468,4 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-#endif // _LIBCPP_HAS_LOCALIZATION
-
#endif // _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_H
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index bbb915d6e982c..9ecd0ff827700 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -2081,12 +2081,13 @@ module std [system] {
}
module text_encoding {
+ module get_locale_encoding { header "__text_encoding/get_locale_encoding.h" }
module text_encoding { header "__text_encoding/text_encoding.h" }
header "text_encoding"
export *
}
-
+
module thread {
module formatter { header "__thread/formatter.h" }
module id { header "__thread/id.h" }
diff --git a/libcxx/include/text_encoding b/libcxx/include/text_encoding
index 579608e4f939d..b41913a57bd72 100644
--- a/libcxx/include/text_encoding
+++ b/libcxx/include/text_encoding
@@ -10,7 +10,7 @@
#ifndef _LIBCPP_TEXT_ENCODING
#define _LIBCPP_TEXT_ENCODING
-/* text_encoding synopsis
+/* text_encoding synopsis
namespace std {
struct text_encoding;
@@ -19,11 +19,11 @@ struct text_encoding;
template<class T> struct hash;
template<> struct hash<text_encoding>;
-struct text_encoding
+struct text_encoding
{
static constexpr size_t max_name_length = 63;
- // [text.encoding.id], enumeration text_encoding::id
+ // [text.encoding.id], enumeration text_encoding::id
enum class id : int_least32_t {
see below
};
@@ -36,8 +36,8 @@ struct text_encoding
constexpr id mib() const noexcept;
constexpr const char* name() const noexcept;
- // [text.encoding.aliases], class text_encoding::aliases_view
- struct aliases_view;
+ // [text.encoding.aliases], class text_encoding::aliases_view
+ // struct aliases_view;
constexpr aliases_view aliases() const noexcept;
friend constexpr bool operator==(const text_encoding& a,
@@ -59,10 +59,12 @@ struct text_encoding
#include <__config>
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
#if _LIBCPP_STD_VER >= 26
-# include <__text_encoding/text_encoding.h>
+# include <__text_encoding/text_encoding.h>
#endif // _LIBCPP_STD_VER >= 26
-#include <version>
-
-#endif // _LIBCPP_TEXT_ENCODING
+#endif // _LIBCPP_TEXT_ENCODING
diff --git a/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
index 6ebdab96ed455..88abb71fc9bc7 100644
--- a/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -96,6 +96,7 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE6do_outERPcPKwS5_RS5_S2_S2_S3_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthERPcPKcS5_m', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__115error_condition7messageEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
+{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__117bad_function_call4whatEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__118__time_get_storageIcE15__do_date_orderEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__118__time_get_storageIwE15__do_date_orderEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
@@ -410,6 +411,7 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__112system_errorD0Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__112system_errorD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__112system_errorD2Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
+{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113__hash_memoryEPKvm', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113random_deviceD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
@@ -418,7 +420,6 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED2Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113shared_futureIvEaSERKS1_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113__hash_memoryEPKvm', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__114__num_get_base5__srcE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__114__num_put_base12__format_intEPcPKcbj', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
@@ -503,7 +504,6 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117bad_function_callD0Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117bad_function_callD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117bad_function_callD2Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__117bad_function_call4whatEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117iostream_categoryEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
@@ -555,6 +555,7 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIlNS_22__cxx_atomic_base_implIlEEEEl', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvl', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
+{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingB8ne210000EPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
diff --git a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
index 8c55c4385f6f6..e4ec115d736bc 100644
--- a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -35,6 +35,7 @@
{'is_defined': False, 'name': '_ZTVSt13runtime_error', 'size': 0, 'type': 'OBJECT'}
{'is_defined': False, 'name': '_ZTVSt14overflow_error', 'size': 0, 'type': 'OBJECT'}
{'is_defined': False, 'name': '_ZTVSt16invalid_argument', 'size': 0, 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZTVSt9exception', 'size': 0, 'type': 'OBJECT'}
{'is_defined': False, 'name': '_ZdaPv', 'type': 'FUNC'}
{'is_defined': False, 'name': '_ZdaPvSt11align_val_t', 'type': 'FUNC'}
{'is_defined': False, 'name': '_ZdlPv', 'type': 'FUNC'}
@@ -225,6 +226,7 @@
{'is_defined': True, 'name': '_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNKSt3__115error_condition7messageEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117bad_function_call4whatEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv', 'type': 'FUNC'}
@@ -773,6 +775,7 @@
{'is_defined': True, 'name': '_ZNSt3__112system_errorD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__112system_errorD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__112system_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113__hash_memoryEPKvm', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE11__read_modeEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE12__write_modeEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
@@ -953,7 +956,6 @@
{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED2Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvEaSERKS1_', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__113__hash_memoryEPKvm', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__114__num_get_base5__srcE', 'size': 33, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZNSt3__114__num_put_base12__format_intEPcPKcbj', 'type': 'FUNC'}
@@ -1156,7 +1158,6 @@
{'is_defined': True, 'name': '_ZNSt3__117bad_function_callD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__117bad_function_callD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__117bad_function_callD2Ev', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNKSt3__117bad_function_call4whatEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__117iostream_categoryEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc', 'type': 'FUNC'}
@@ -1214,6 +1215,7 @@
{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEEi', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvi', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingB8ne210000EPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'type': 'FUNC'}
@@ -1964,6 +1966,8 @@
{'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 96, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 96, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 96, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__120__time_get_c_storageIcEE', 'size': 72, 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZTVNSt3__120__time_get_c_storageIwEE', 'size': 72, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZTVNSt3__13pmr15memory_resourceE', 'size': 56, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZTVNSt3__13pmr25monotonic_buffer_resourceE', 'size': 56, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZTVNSt3__13pmr26synchronized_pool_resourceE', 'size': 56, 'type': 'OBJECT'}
diff --git a/libcxx/modules/std.cppm.in b/libcxx/modules/std.cppm.in
index 32abeca7e0236..08a39f64bc1e3 100644
--- a/libcxx/modules/std.cppm.in
+++ b/libcxx/modules/std.cppm.in
@@ -110,9 +110,7 @@ module;
#include <strstream>
#include <syncstream>
#include <system_error>
-#if _LIBCPP_HAS_LOCALIZATION
-# include <text_encoding>
-#endif
+#include <text_encoding>
#include <thread>
#include <tuple>
#include <type_traits>
diff --git a/libcxx/modules/std/text_encoding.inc b/libcxx/modules/std/text_encoding.inc
index 23dd71965414c..8ad1e7bfced43 100644
--- a/libcxx/modules/std/text_encoding.inc
+++ b/libcxx/modules/std/text_encoding.inc
@@ -9,8 +9,10 @@
export namespace std {
#if _LIBCPP_STD_VER >= 26
- using ::std::hash;
+ using std::hash;
+ namespace ranges {
+ using std::ranges::enable_borrowed_range;
+ }
using std::text_encoding;
- using ::std::ranges::enable_borrowed_range;
#endif
} // namespace std
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 84349ea787081..da735865c322c 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -553,19 +553,6 @@ locale::locale(const locale& other, const locale& one, category c)
string locale::name() const { return __locale_->name(); }
-# if _LIBCPP_STD_VER >= 26 && __CHAR_BIT__ == 8
- text_encoding locale::encoding() const {
- std::string __name = this->name();
- if(__name.size() == 1){
- if(__name[0] == 'C')
- return std::text_encoding(text_encoding::id::ASCII);
- if(__name[0] == '*')
- return std::text_encoding();
- }
- return std::text_encoding(__name);
- }
-# endif // _LIBCPP_STD_VER >= 26
-
void locale::__install_ctor(const locale& other, facet* f, long facet_id) {
if (f)
__locale_ = new __imp(*other.__locale_, f, facet_id);
diff --git a/libcxx/src/text_encoding.cpp b/libcxx/src/text_encoding.cpp
index 42812aaed49c7..d02c4c1b566a5 100644
--- a/libcxx/src/text_encoding.cpp
+++ b/libcxx/src/text_encoding.cpp
@@ -6,44 +6,26 @@
//
//===----------------------------------------------------------------------===//
-#include <__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
+#include <__config>
#include <__locale_dir/locale_base_api.h>
-
-#include <text_encoding>
-
-#if __has_include(<langinfo.h>)
-# include <langinfo.h>
-#endif
-
-#if _LIBCPP_STD_VER >= 26
+#include <__text_encoding/get_locale_encoding.h>
_LIBCPP_BEGIN_NAMESPACE_STD
-#if __CHAR_BIT__ == 8
-
-text_encoding text_encoding::environment() {
- auto __make_locale = [](const char* __name) {
- text_encoding __enc{};
- if (auto __loc = __locale::__newlocale(LC_CTYPE_MASK, __name, static_cast<locale_t>(0))) {
- if (const char* __codeset = nl_langinfo_l(CODESET, __loc)) {
- string_view __s(__codeset);
- if (__s.size() < max_name_length)
- __enc = text_encoding(__s);
- }
- __locale::__freelocale(__loc);
- }
- return __enc;
- };
-
- return __make_locale("");
+_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
+
+string_view __get_locale_encoding(const char* __name) {
+ std::string_view __encoding_str{""};
+ if (auto __loc = __locale::__newlocale(LC_CTYPE_MASK, __name, static_cast<locale_t>(0))) {
+ if (const char* __codeset = __locale::__nl_langinfo_l(CODESET, __loc)) {
+ string_view __s(__codeset);
+ if (__s.size() < 63)
+ __encoding_str = __s;
+ }
+ __locale::__freelocale(__loc);
}
+ return __encoding_str;
+}
-# endif // __CHAR_BIT__ == 8
-
+_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_STD_VER > 26
diff --git a/libcxx/test/libcxx/transitive_includes/cxx26.csv b/libcxx/test/libcxx/transitive_includes/cxx26.csv
index 9f5d81d8fc7ca..94b06b8bcb444 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx26.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx26.csv
@@ -1049,11 +1049,9 @@ system_error string_view
system_error tuple
system_error version
text_encoding cctype
-text_encoding clocale
text_encoding compare
text_encoding cstdint
text_encoding cstdio
-text_encoding cstdlib
text_encoding cstring
text_encoding cwchar
text_encoding cwctype
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
index ea6b07934510a..56a9e9f92b446 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
@@ -37,9 +37,9 @@
#ifdef _AIX
// the AIX libc expects U202F as LC_MONETARY thousands_sep
-# define THOUSANDS_SEP L"\u202F"
+# define THOUSANDS_SEP_ L"\u202F"
#else
-# define THOUSANDS_SEP L" "
+# define THOUSANDS_SEP_ L" "
#endif
typedef std::money_get<char, cpp17_input_iterator<const char*> > Fn;
@@ -443,7 +443,7 @@ int main(int, char**)
assert(ex == -1);
}
{ // positive
- std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 ");
+ std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 ");
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -453,7 +453,7 @@ int main(int, char**)
assert(ex == 123456789);
}
{ // negative
- std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89");
+ std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89");
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -521,7 +521,7 @@ int main(int, char**)
assert(ex == -1);
}
{ // positive, showbase
- std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac"); // EURO SIGN
+ std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 \u20ac"); // EURO SIGN
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -531,7 +531,7 @@ int main(int, char**)
assert(ex == 123456789);
}
{ // positive, showbase
- std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac"); // EURO SIGN
+ std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 \u20ac"); // EURO SIGN
std::showbase(ios);
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
@@ -543,7 +543,7 @@ int main(int, char**)
std::noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac"); // EURO SIGN
+ std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 \u20ac"); // EURO SIGN
std::showbase(ios);
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
@@ -555,7 +555,7 @@ int main(int, char**)
std::noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR -");
+ std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 EUR -");
std::showbase(ios);
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
@@ -566,7 +566,7 @@ int main(int, char**)
std::noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR -");
+ std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 EUR -");
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -602,7 +602,7 @@ int main(int, char**)
assert(ex == -1);
}
{ // positive
- std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 ");
+ std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 ");
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -612,7 +612,7 @@ int main(int, char**)
assert(ex == 123456789);
}
{ // negative
- std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89");
+ std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89");
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -680,7 +680,7 @@ int main(int, char**)
assert(ex == -1);
}
{ // positive, showbase
- std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR");
+ std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 EUR");
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -690,7 +690,7 @@ int main(int, char**)
assert(ex == 123456789);
}
{ // positive, showbase
- std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR");
+ std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 EUR");
std::showbase(ios);
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
@@ -702,7 +702,7 @@ int main(int, char**)
std::noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR");
+ std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 EUR");
std::showbase(ios);
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
@@ -714,7 +714,7 @@ int main(int, char**)
std::noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 Eu-");
+ std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 Eu-");
std::showbase(ios);
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
@@ -725,7 +725,7 @@ int main(int, char**)
std::noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 Eu-");
+ std::wstring v = convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 Eu-");
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
std::ios_base::iostate err = std::ios_base::goodbit;
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
index 14745996b9fd1..8f65590194398 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_fr_FR.pass.cpp
@@ -37,9 +37,9 @@
#ifdef _AIX
// the AIX libc expects U202F as LC_MONETARY thousands_sep
-# define THOUSANDS_SEP L"\u202F"
+# define THOUSANDS_SEP_ L"\u202F"
#else
-# define THOUSANDS_SEP L" "
+# define THOUSANDS_SEP_ L" "
#endif
typedef std::money_put<char, cpp17_output_iterator<char*> > Fn;
@@ -302,14 +302,14 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, '*', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89"));
+ assert(ex == convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89"));
}
{ // negative
long double v = -123456789;
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, '*', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89"));
+ assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89"));
}
{ // zero, showbase
long double v = 0;
@@ -333,7 +333,7 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, '*', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac"));
+ assert(ex == convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 \u20ac"));
}
{ // negative, showbase
long double v = -123456789;
@@ -341,7 +341,7 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, '*', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac"));
+ assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 \u20ac"));
}
{ // negative, showbase, left
long double v = -123456789;
@@ -351,7 +351,7 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, ' ', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac "));
+ assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 \u20ac "));
assert(ios.width() == 0);
}
{ // negative, showbase, internal
@@ -362,7 +362,7 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, ' ', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac"));
+ assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 \u20ac"));
assert(ios.width() == 0);
}
{ // negative, showbase, right
@@ -373,7 +373,7 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), false, ios, ' ', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L" -1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 \u20ac"));
+ assert(ex == convert_thousands_sep(L" -1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 \u20ac"));
assert(ios.width() == 0);
}
@@ -399,14 +399,14 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, '*', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89"));
+ assert(ex == convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89"));
}
{ // negative
long double v = -123456789;
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, '*', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89"));
+ assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89"));
}
{ // zero, showbase
long double v = 0;
@@ -430,7 +430,7 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, '*', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR"));
+ assert(ex == convert_thousands_sep(L"1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 EUR"));
}
{ // negative, showbase
long double v = -123456789;
@@ -438,7 +438,7 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, '*', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR"));
+ assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 EUR"));
}
{ // negative, showbase, left
long double v = -123456789;
@@ -448,7 +448,7 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, ' ', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR "));
+ assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 EUR "));
assert(ios.width() == 0);
}
{ // negative, showbase, internal
@@ -459,7 +459,7 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, ' ', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR"));
+ assert(ex == convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 EUR"));
assert(ios.width() == 0);
}
{ // negative, showbase, right
@@ -470,7 +470,7 @@ int main(int, char**)
wchar_t str[100];
cpp17_output_iterator<wchar_t*> iter = f.put(cpp17_output_iterator<wchar_t*>(str), true, ios, ' ', v);
std::wstring ex(str, base(iter));
- assert(ex == convert_thousands_sep(L" -1" THOUSANDS_SEP "234" THOUSANDS_SEP "567,89 EUR"));
+ assert(ex == convert_thousands_sep(L" -1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 EUR"));
assert(ios.width() == 0);
}
}
diff --git a/libcxx/test/std/localization/locales/locale/locale.members/encoding.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.members/encoding.pass.cpp
index 7ebfb5a0b4f74..b64928ccb146e 100644
--- a/libcxx/test/std/localization/locales/locale/locale.members/encoding.pass.cpp
+++ b/libcxx/test/std/localization/locales/locale/locale.members/encoding.pass.cpp
@@ -1,4 +1,3 @@
-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@@ -9,8 +8,6 @@
// <text_encoding>
-// libc++ not built with C++26 yet
-// XFAIL: *
// REQUIRES: std-at-least-c++26
// REQUIRES: locale.en_US.UTF-8
// UNSUPPORTED: no-localization
@@ -33,11 +30,10 @@
using id = std::text_encoding::id;
int main() {
-
{
std::locale loc;
- auto te = loc.encoding();
+ auto te = loc.encoding();
auto classicTE = std::text_encoding(id::ASCII);
assert(te == id::ASCII);
assert(te == classicTE);
@@ -46,11 +42,11 @@ int main() {
{
std::locale utf8Locale(LOCALE_en_US_UTF_8);
- auto te = utf8Locale.encoding();
+ auto te = utf8Locale.encoding();
auto utf8TE = std::text_encoding(id::UTF8);
assert(te == id::UTF8);
assert(te == utf8TE);
}
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp
index 62c30d7295491..2baa7bd298116 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp
@@ -21,7 +21,7 @@
// 2. Default constructing a text_encoding object makes it so that mib() == id::unknown, and its name is empty
#include <cassert>
-#include <cstring>
+#include <string_view>
#include <text_encoding>
#include <type_traits>
@@ -34,6 +34,11 @@ int main(int, char**) {
{
auto te = std::text_encoding();
assert(te.mib() == std::text_encoding::id::unknown);
- assert(strcmp(te.name(), "") == 0);
+ assert(std::string_view("").compare(te.name()) == 0);
+ }
+ {
+ constexpr auto te = std::text_encoding();
+ static_assert(te.mib() == std::text_encoding::id::unknown);
+ static_assert(std::string_view("").compare(te.name()) == 0);
}
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp
index 6562971c73dbb..f04e4df1a1d38 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp
@@ -22,18 +22,60 @@
// 3. Constructing an object using id::unknown must set mib() to id::unknown and the name to an empty string.
// 4. Constructing an object using id::other must set mib() to id::other and the name to an empty string.
-#include "test_text_encoding.h"
+#include <algorithm>
#include <cassert>
+#include <print>
#include <string_view>
#include <text_encoding>
#include <type_traits>
+#include "test_text_encoding.h"
+
using te_id = std::text_encoding::id;
-constexpr void test_ctor(te_id i, te_id expect_id, std::string_view expect_name) {
+constexpr bool test_ctor(te_id i, te_id expect_id, std::string_view expect_name) {
auto te = std::text_encoding(i);
- assert(te.mib() == expect_id);
- assert(expect_name.compare(te.name()) == 0);
+ if (te.mib() != expect_id) {
+ return false;
+ }
+ if (expect_name.compare(te.name()) != 0) {
+ return false;
+ }
+ if (!std::ranges::contains(te.aliases(), std::string_view(te.name()))) {
+ return false;
+ }
+ return true;
+}
+
+constexpr bool test_ctors_static() {
+ for (auto pair : unique_encoding_data) {
+ if (!test_ctor(te_id{pair.mib}, te_id{pair.mib}, pair.name)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+constexpr bool test_unknown() {
+ constexpr auto te = std::text_encoding(te_id::unknown);
+ if (te.mib() != te_id::unknown) {
+ return false;
+ }
+ if (std::string_view(te.name()).compare(te.name()) != 0) {
+ return false;
+ }
+ return true;
+}
+
+constexpr bool test_other() {
+ constexpr auto te = std::text_encoding(te_id::other);
+ if (te.mib() != te_id::other) {
+ return false;
+ }
+ if (std::string_view(te.name()).compare(te.name()) != 0) {
+ return false;
+ }
+ return true;
}
int main() {
@@ -41,16 +83,30 @@ int main() {
static_assert(std::is_nothrow_constructible<std::text_encoding, std::text_encoding::id>::value,
"Must be nothrow constructible with id");
}
-
+
{
- for (auto pair : unique_encoding_data){
- test_ctor(te_id{pair.mib}, te_id{pair.mib}, pair.name);
+ for (auto pair : unique_encoding_data) {
+ assert(test_ctor(te_id{pair.mib}, te_id{pair.mib}, pair.name));
}
}
{
- for(int i = 2261; i < 2300; i++){ // test out of range id values
- test_ctor(te_id{i}, te_id::unknown, "");
- }
+ static_assert(test_ctors_static());
+ }
+
+ {
+ static_assert(test_unknown());
+ }
+
+ {
+ assert(test_unknown());
+ }
+
+ {
+ static_assert(test_other());
+ }
+
+ {
+ assert(test_other());
}
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp
index b72adf0274cb2..09d86003a4a32 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp
@@ -16,24 +16,27 @@
// text_encoding::text_encoding(string_view) noexcept
-#include "test_macros.h"
-#include "test_text_encoding.h"
#include <cassert>
#include <cstring>
#include <string_view>
#include <text_encoding>
#include <type_traits>
-constexpr void test_ctor(std::string_view str, std::string_view expect, std::text_encoding::id expect_id) {
+#include "test_macros.h"
+#include "test_text_encoding.h"
+
+constexpr bool test_ctor(std::string_view str, std::string_view expect, std::text_encoding::id expect_id) {
auto te = std::text_encoding(str);
- assert(te.mib() == expect_id);
- assert(expect.compare(te.name()) == 0);
+ return te.mib() == expect_id && expect.compare(te.name()) == 0;
}
-void test_correct_encoding_spellings() {
+constexpr bool test_correct_encoding_spellings() {
for (auto pair : unique_encoding_data) {
- test_ctor(pair.name, pair.name, std::text_encoding::id{pair.mib});
+ if (!test_ctor(pair.name, pair.name, std::text_encoding::id{pair.mib})) {
+ return false;
+ }
}
+ return true;
}
int main() {
@@ -44,30 +47,36 @@ int main() {
// happy paths
{
- test_correct_encoding_spellings();
+ assert(test_correct_encoding_spellings());
}
{
- test_ctor("U_T_F-8", "U_T_F-8", std::text_encoding::UTF8);
+ static_assert(test_ctor("U_T_F-8", "U_T_F-8", std::text_encoding::UTF8));
+ assert(test_ctor("U_T_F-8", "U_T_F-8", std::text_encoding::UTF8));
}
{
- test_ctor("utf8", "utf8", std::text_encoding::UTF8);
+ static_assert(test_ctor("utf8", "utf8", std::text_encoding::UTF8));
+ assert(test_ctor("utf8", "utf8", std::text_encoding::UTF8));
}
{
- test_ctor("u.t.f-008", "u.t.f-008", std::text_encoding::UTF8);
+ static_assert(test_ctor("u.t.f-008", "u.t.f-008", std::text_encoding::UTF8));
+ assert(test_ctor("u.t.f-008", "u.t.f-008", std::text_encoding::UTF8));
}
{
- test_ctor("utf-80", "utf-80", std::text_encoding::other);
+ static_assert(test_ctor("utf-80", "utf-80", std::text_encoding::other));
+ assert(test_ctor("utf-80", "utf-80", std::text_encoding::other));
}
{
- test_ctor("iso885931988", "iso885931988", std::text_encoding::ISOLatin3);
+ static_assert(test_ctor("iso885931988", "iso885931988", std::text_encoding::ISOLatin3));
+ assert(test_ctor("iso885931988", "iso885931988", std::text_encoding::ISOLatin3));
}
{
- test_ctor("iso00885931988", "iso00885931988", std::text_encoding::ISOLatin3);
+ static_assert(test_ctor("iso00885931988", "iso00885931988", std::text_encoding::ISOLatin3));
+ assert(test_ctor("iso00885931988", "iso00885931988", std::text_encoding::ISOLatin3));
}
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp
index 30ce1badec1d7..f7b2af8299490 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp
@@ -14,7 +14,7 @@
// class text_encoding
-// text_encoding operator==(const text_encoding&, id) _NOEXCEPT
+// text_encoding operator==(const text_encoding&, id) _NOEXCEPT
// Concerns:
// 1. operator==(const text_encoding&, id) must be noexcept
@@ -23,7 +23,6 @@
#include <cassert>
#include <text_encoding>
-#include <type_traits>
#include "test_macros.h"
#include "test_text_encoding.h"
@@ -31,7 +30,6 @@
using id = std::text_encoding::id;
int main() {
-
{ // 1
auto te = std::text_encoding();
ASSERT_NOEXCEPT(te == id::UTF8);
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp
index 81fdb0a681143..c44bff8239796 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp
@@ -14,7 +14,7 @@
// class text_encoding
-// text_encoding operator==(const text_encoding&, const text_encoding&) _NOEXCEPT
+// text_encoding operator==(const text_encoding&, const text_encoding&) _NOEXCEPT
// Concerns:
// 1. operator==(const text_encoding&, const text_encoding&) must be noexcept
@@ -25,15 +25,13 @@
#include <cassert>
#include <text_encoding>
-#include <type_traits>
#include "test_macros.h"
#include "test_text_encoding.h"
using id = std::text_encoding::id;
-int main(){
-
+int main() {
{ // 1
auto te1 = std::text_encoding();
auto te2 = std::text_encoding();
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp
index 345438d6a1ecb..77fb2779de809 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp
@@ -9,26 +9,24 @@
// <text_encoding>
// REQUIRES: std-at-least-c++26
-// UNSUPPORTED: no-localization
// class text_encoding
-// text_encoding text_encoding::environment();
+// text_encoding text_encoding::aliases();
// Concerns:
-// 1. Verify that text_encoding::aliases_view satisfies ranges::forward_range, copyable, view,
+// 1. Verify that text_encoding::aliases_view satisfies ranges::forward_range, copyable, view,
// ranges::random_access_range and ranges::borrowed_range
#include <concepts>
#include <ranges>
#include <text_encoding>
-#include <type_traits>
-#include "platform_support.h"
+#include "platform_support.h"
#include "test_macros.h"
#include "test_text_encoding.h"
-int main(){
+int main() {
static_assert(std::ranges::forward_range<std::text_encoding::aliases_view>);
static_assert(std::copyable<std::text_encoding::aliases_view>);
static_assert(std::ranges::view<std::text_encoding::aliases_view>);
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
index c0412d4d39ee1..eaa67648505d7 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
@@ -14,70 +14,74 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: windows
-// libc++ is not built with C++26, and the implementation for this function is in a source file.
-// XFAIL: *
-
// class text_encoding
-// text_encoding text_encoding::environment();
+// text_encoding text_encoding::environment();
// Concerns:
-// 1. text_encoding::environment() returns the encoding for the "C" locale, which should be the default for any C++ program.
-// 2. text_encoding::environment() still returns the "C" locale encoding when the locale is set to "en_US.UTF-8".
-// 3. text_encoding::environment() is affected by changes to the "LANG" environment variable.
+// 1. text_encoding::environment() returns the encoding for the environment's default locale.
+// 2. text_encoding::environment() still returns the default locale encoding when the locale is set to "en_US.UTF-8".
+// 3. text_encoding::environment() is affected by changes to the "LANG" environment variable.
-// The current implementation of text_encoding::environment() while conformant,
+// The current implementation of text_encoding::environment() while conformant,
// is unfortunately affected by changes to the "LANG" environment variable.
#include <cassert>
#include <clocale>
#include <cstdlib>
+#include <string>
#include <string_view>
#include <text_encoding>
-#include "platform_support.h"
+#include "platform_support.h"
#include "test_macros.h"
#include "test_text_encoding.h"
-int main() {
+std::string extractEncodingFromLocale(std::string locale_str) {
+ auto dot_pos = locale_str.find('.'), at_pos = locale_str.find('@');
- { // 1
- auto te = std::text_encoding::environment();
+ if (dot_pos == std::string::npos) {
+ return "ANSI_X3.4-1968"; // default is ASCII
+ }
- assert(te == std::text_encoding::environment());
- assert(te.mib() == std::text_encoding::id::ASCII);
- assert(te == std::text_encoding::id::ASCII);
- assert(std::string_view(te.name()) == "ANSI_X3.4-1968");
- assert(te == std::text_encoding("ANSI_X3.4-1968"));
+ if (at_pos == std::string::npos) {
+ return locale_str.substr(dot_pos + 1);
+ }
+
+ return locale_str.substr(dot_pos + 1, at_pos - 1 - dot_pos);
+}
- assert(std::text_encoding::environment_is<std::text_encoding::id::ASCII>());
+int main() {
+ auto default_locale = std::setlocale(LC_ALL, nullptr);
+ auto default_encoding = extractEncodingFromLocale(std::string(default_locale));
+ auto default_te = std::text_encoding(default_encoding);
+
+ { // 1
+ auto env_te = std::text_encoding::environment();
+ assert(env_te == std::text_encoding::environment());
+ assert(checkTextEncoding(env_te, default_te));
}
{ // 2
- std::setlocale(LC_ALL, "en_US.UTF-8");
-
- auto te = std::text_encoding::environment();
+ std::setlocale(LC_ALL, LOCALE_en_US_UTF_8);
- assert(te == std::text_encoding::environment());
- assert(te.mib() == std::text_encoding::id::ASCII);
- assert(std::string_view(te.name()) == "ANSI_X3.4-1968");
- assert(te == std::text_encoding("ANSI_X3.4-1968"));
+ auto env_te = std::text_encoding::environment();
- assert(std::text_encoding::environment_is<std::text_encoding::id::ASCII>());
+ assert(checkTextEncoding(env_te, default_te));
}
{ // 3
setenv("LANG", LOCALE_en_US_UTF_8, 1);
-
+
auto te = std::text_encoding::environment();
assert(te == std::text_encoding::environment());
assert(te.mib() == std::text_encoding::id::UTF8);
assert(std::string_view(te.name()) == "UTF-8");
- assert(te == std::text_encoding("UTF-8"));
+ assert(checkTextEncoding(te, std::text_encoding("UTF-8")));
assert(std::text_encoding::environment_is<std::text_encoding::id::UTF8>());
}
-
+
return 0;
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp
index 200f9630de580..df58d13bdab6b 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp
@@ -11,8 +11,6 @@
// REQUIRES: std-at-least-c++26
-// UNSUPPORTED: no-localization
-
// class text_encoding
// text_encoding text_encoding::literal() noexcept;
@@ -21,25 +19,21 @@
// 1. text_encoding::literal() returns the proper encoding depending on the compiler, else unknown.
#include <cassert>
-#include <text_encoding>
-#include <type_traits>
#include <string_view>
+#include <text_encoding>
#include "test_macros.h"
#include "test_text_encoding.h"
int main() {
#if __CHAR_BIT__ == 8
-
+
{
auto te = std::text_encoding::literal();
# ifdef __GNUC_EXECUTION_CHARSET_NAME
assert(std::string_view(te.name()) == std::string_view(__GNUC_EXECUTION_CHARSET_NAME));
# elif defined(__clang_literal_encoding__)
assert(std::string_view(te.name()) == std::string_view(__clang_literal_encoding__));
-# elif defined(__clang__)
- assert(std::string_view(te.name()) == "UTF-8");
- assert(te.mib() == std::text_encoding::id::UTF8);
# else
assert(te.mib() = std::text_encoding::id::unknown);
# endif
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/nodiscard.verify.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/nodiscard.verify.cpp
new file mode 100644
index 0000000000000..e5462d030d844
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/nodiscard.verify.cpp
@@ -0,0 +1,37 @@
+
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// class text_encoding
+
+// Concerns:
+// 1. Verify that text_encoding member functions are nodiscard
+
+#include <text_encoding>
+
+int main() {
+ auto te = std::text_encoding();
+ // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ te.mib();
+ // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ te.name();
+ // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ te.aliases();
+ // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ te.environment();
+ // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ te.environment_is<std::text_encoding::id::unknown>();
+
+ // Clang does not emit a nodiscard warning for consteval functions with [[nodiscard]]: See #141536
+ // expected-warning at +1 {{expression result unused}}
+ std::text_encoding::literal();
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp
index 61c148f854813..03a9f763ad9a8 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp
@@ -10,57 +10,50 @@
// REQUIRES: std-at-least-c++26
-// UNSUPPORTED: no-localization
-
-// class text_encoding
-
-// text_encoding text_encoding::environment();
+// struct text_encoding::aliases_view
// Concerns:
// 1. begin() of an aliases_view() from a single text_encoding object are the same.
// 2. begin() of aliases_views of two text_encoding objects that represent the same ID but hold different names are the same.
-// 3. begin() of aliases_views of two text_encoding objects that represent different IDs are different.
+// 3. begin() of aliases_views of two text_encoding objects that represent different IDs are different.
#include <cassert>
#include <cstdlib>
#include <text_encoding>
#include <ranges>
-#include "platform_support.h"
+#include "platform_support.h"
#include "test_macros.h"
#include "test_text_encoding.h"
using id = std::text_encoding::id;
int main() {
-
{
- auto te = std::text_encoding(id::UTF8);
+ auto te = std::text_encoding(id::UTF8);
auto view1 = te.aliases();
auto view2 = te.aliases();
-
- assert(std::ranges::begin(view1) == std::ranges::begin(view2));
+
+ assert(std::ranges::begin(view1) == std::ranges::begin(view2));
}
{
auto te1 = std::text_encoding("ANSI_X3.4-1968");
auto te2 = std::text_encoding("ANSI_X3.4-1986");
- auto view1 = te1.aliases();
+ auto view1 = te1.aliases();
auto view2 = te2.aliases();
assert(std::ranges::begin(view1) == std::ranges::begin(view2));
}
{
-
auto te1 = std::text_encoding(id::UTF8);
auto te2 = std::text_encoding(id::ASCII);
-
+
auto view1 = te1.aliases();
auto view2 = te2.aliases();
assert(!(std::ranges::begin(view1) == std::ranges::begin(view2)));
}
-
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp
index 253a060dc0961..f645dfa7897d4 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp
@@ -10,11 +10,7 @@
// REQUIRES: std-at-least-c++26
-// UNSUPPORTED: no-localization
-
-// class text_encoding
-
-// text_encoding text_encoding::environment();
+// struct text_encoding::aliases_view
// Concerns:
// 1. An alias_view of a text_encoding object for "other" is empty
@@ -26,25 +22,24 @@
#include <ranges>
#include <text_encoding>
-#include "platform_support.h"
+#include "platform_support.h"
#include "test_macros.h"
#include "test_text_encoding.h"
using id = std::text_encoding::id;
-int main(){
-
+int main() {
{
- auto te = std::text_encoding(id::other);
+ auto te = std::text_encoding(id::other);
auto empty_range = te.aliases();
-
+
assert(std::ranges::empty(empty_range));
assert(empty_range.empty());
assert(!bool(empty_range));
}
{
- auto te = std::text_encoding(id::unknown);
+ auto te = std::text_encoding(id::unknown);
auto empty_range = te.aliases();
assert(std::ranges::empty(empty_range));
@@ -53,12 +48,11 @@ int main(){
}
{
- auto te = std::text_encoding(id::UTF8);
+ auto te = std::text_encoding(id::UTF8);
auto range = te.aliases();
assert(!std::ranges::empty(range));
assert(!range.empty());
assert(bool(range));
}
-
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp
index fb9f80247b1ac..bc65891c08f09 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp
@@ -10,35 +10,30 @@
// REQUIRES: std-at-least-c++26
-// UNSUPPORTED: no-localization
-
-// class text_encoding
-
-// text_encoding text_encoding::environment();
+// struct text_encoding::aliases_view
// Concerns:
// 1. An aliases_view from a single text_encoding object returns the same front()
// 2. An aliases_views of two text_encoding objects that represent the same ID but hold different names return the same front()
-// 3. An aliases_views of two text_encoding objects that represent different IDs return different front()
+// 3. An aliases_views of two text_encoding objects that represent different IDs return different front()
#include <cassert>
#include <cstdlib>
#include <text_encoding>
-#include "platform_support.h"
+#include "platform_support.h"
#include "test_macros.h"
#include "test_text_encoding.h"
using id = std::text_encoding::id;
int main() {
-
{
auto te = std::text_encoding(id::UTF8);
-
+
auto view1 = te.aliases();
auto view2 = te.aliases();
-
+
assert(view1.front() == view2.front());
}
@@ -46,21 +41,19 @@ int main() {
auto te1 = std::text_encoding("ANSI_X3.4-1968");
auto te2 = std::text_encoding("ANSI_X3.4-1986");
- auto view1 = te1.aliases();
+ auto view1 = te1.aliases();
auto view2 = te2.aliases();
assert(view1.front() == view2.front());
}
{
-
auto te1 = std::text_encoding(id::UTF8);
auto te2 = std::text_encoding(id::ASCII);
-
+
auto view1 = te1.aliases();
auto view2 = te2.aliases();
assert(!(view1.front() == view2.front()));
}
-
}
diff --git a/libcxx/test/support/test_text_encoding.h b/libcxx/test/support/test_text_encoding.h
index 460a259722f0d..3d41cb9489ef8 100644
--- a/libcxx/test/support/test_text_encoding.h
+++ b/libcxx/test/support/test_text_encoding.h
@@ -9,15 +9,20 @@
#ifndef SUPPORT_TEST_TEXT_ENCODING_H
#define SUPPORT_TEST_TEXT_ENCODING_H
-#include "test_macros.h"
+#include <array>
#include <cstdint>
+#include <iostream>
+#include <print>
+
+#include "test_macros.h"
struct encoding_pair {
int_least32_t mib;
const char* name;
};
-constexpr encoding_pair all_encoding_data[] = {
+constexpr std::array<const encoding_pair, 882> all_encoding_data{{
+
{1, ""},
{2, ""},
{3, "ANSI_X3.4-1968"},
@@ -169,12 +174,6 @@ constexpr encoding_pair all_encoding_data[] = {
{32, "NATS-SEFI-ADD"},
{32, "csNATSSEFIADD"},
{32, "iso-ir-8-2"},
- {33, "NATS-DANO"},
- {33, "csNATSDANO"},
- {33, "iso-ir-9-1"},
- {34, "NATS-DANO-ADD"},
- {34, "csNATSDANOADD"},
- {34, "iso-ir-9-2"},
{35, "SEN_850200_B"},
{35, "FI"},
{35, "ISO646-FI"},
@@ -906,10 +905,9 @@ constexpr encoding_pair all_encoding_data[] = {
{2259, "csTIS620"},
{2260, "CP50220"},
{2260, "csCP50220"},
- {0, nullptr} // sentinel
-};
+}};
-constexpr encoding_pair unique_encoding_data[] = {
+constexpr std::array<const encoding_pair, 256> unique_encoding_data{{
{3, "ANSI_X3.4-1968"},
{4, "ISO-8859-1"},
{5, "ISO-8859-2"},
@@ -940,8 +938,6 @@ constexpr encoding_pair unique_encoding_data[] = {
{30, "ISO_646.irv:1983"},
{31, "NATS-SEFI"},
{32, "NATS-SEFI-ADD"},
- {33, "NATS-DANO"},
- {34, "NATS-DANO-ADD"},
{35, "SEN_850200_B"},
{36, "KS_C_5601-1987"},
{37, "ISO-2022-KR"},
@@ -1168,6 +1164,28 @@ constexpr encoding_pair unique_encoding_data[] = {
{2258, "windows-1258"},
{2259, "TIS-620"},
{2260, "CP50220"},
-};
+}};
+
+inline bool checkTextEncoding(std::text_encoding te1, std::text_encoding te2) {
+ if (te1 != te2) {
+ std::println(
+ std::cerr,
+ "Text encoding mismatch! [{}] {} vs [{}] {}",
+ int(te1.mib()),
+ te1.name(),
+ int(te2.mib()),
+ te2.name());
+ return false;
+ }
+
+ if (te1.mib() != te2) {
+ std::println(std::cerr, "text encoding id mismatch! {} vs {}", int(te1.mib()), int(te2.mib()));
+ }
+
+ if (std::string_view(te1.name()) != std::string_view(te2.name())) {
+ std::println(std::cerr, "text encoding name mismatch! {} vs {}", te1.name(), te2.name());
+ }
+ return true;
+}
#endif // SUPPORT_TEST_TEXT_ENCODING_H
>From df51559a2ddf65733c6f71c2262cbb62b78a94f5 Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Thu, 29 May 2025 22:39:23 -0400
Subject: [PATCH 3/9] Remove unnecessary code in environment.pass.cpp
---
.../environment.pass.cpp | 23 ++++---------------
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
index eaa67648505d7..58458e53e35fd 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
@@ -19,7 +19,7 @@
// text_encoding text_encoding::environment();
// Concerns:
-// 1. text_encoding::environment() returns the encoding for the environment's default locale.
+// 1. text_encoding::environment() returns the encoding for the environment's default locale, which should be the "C" locale for a C++ program.
// 2. text_encoding::environment() still returns the default locale encoding when the locale is set to "en_US.UTF-8".
// 3. text_encoding::environment() is affected by changes to the "LANG" environment variable.
@@ -29,7 +29,6 @@
#include <cassert>
#include <clocale>
#include <cstdlib>
-#include <string>
#include <string_view>
#include <text_encoding>
@@ -37,26 +36,12 @@
#include "test_macros.h"
#include "test_text_encoding.h"
-std::string extractEncodingFromLocale(std::string locale_str) {
- auto dot_pos = locale_str.find('.'), at_pos = locale_str.find('@');
-
- if (dot_pos == std::string::npos) {
- return "ANSI_X3.4-1968"; // default is ASCII
- }
-
- if (at_pos == std::string::npos) {
- return locale_str.substr(dot_pos + 1);
- }
-
- return locale_str.substr(dot_pos + 1, at_pos - 1 - dot_pos);
-}
-
+using id = std::text_encoding::id;
int main() {
- auto default_locale = std::setlocale(LC_ALL, nullptr);
- auto default_encoding = extractEncodingFromLocale(std::string(default_locale));
- auto default_te = std::text_encoding(default_encoding);
+ auto default_te = std::text_encoding(id::ASCII);
{ // 1
+
auto env_te = std::text_encoding::environment();
assert(env_te == std::text_encoding::environment());
assert(checkTextEncoding(env_te, default_te));
>From 14317bf6835b9fda5468d5e96a00cdb87ede792a Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Tue, 3 Jun 2025 20:07:28 -0400
Subject: [PATCH 4/9] Move existing text_encoding impl to __text_encoding_rep,
make new text_encoding struct that holds the implementation, allow us to
implement environment() without getting hit by C++ version guards Update
tests Clean up locale_base_api support files for platforms that have
<langinfo.h>
---
libcxx/include/CMakeLists.txt | 2 +-
libcxx/include/__locale | 14 +-
.../__locale_dir/locale_base_api/ibm.h | 8 +-
.../include/__locale_dir/support/bsd_like.h | 7 +-
libcxx/include/__locale_dir/support/linux.h | 6 +-
.../__text_encoding/get_locale_encoding.h | 29 -
.../include/__text_encoding/text_encoding.h | 1310 +---------
.../__text_encoding/text_encoding_rep.h | 1307 +++++++++
libcxx/include/module.modulemap.in | 2 +-
libcxx/include/text_encoding | 27 +-
...bcxxabi.v1.stable.exceptions.nonew.abilist | 5 +-
...bcxxabi.v1.stable.exceptions.nonew.abilist | 2 +-
...bcxxabi.v1.stable.exceptions.nonew.abilist | 7 +-
...xxabi.v1.stable.noexceptions.nonew.abilist | 3 +-
libcxx/src/text_encoding.cpp | 318 ++-
.../test/libcxx/transitive_includes/cxx03.csv | 1 +
.../test/libcxx/transitive_includes/cxx11.csv | 1 +
.../test/libcxx/transitive_includes/cxx14.csv | 1 +
.../test/libcxx/transitive_includes/cxx17.csv | 1 +
.../test/libcxx/transitive_includes/cxx20.csv | 1 +
.../test/libcxx/transitive_includes/cxx23.csv | 15 +
.../test/libcxx/transitive_includes/cxx26.csv | 27 +
.../text_encoding.version.compile.pass.cpp | 1 -
.../get_long_double_fr_FR.pass.cpp | 3 +-
.../text_encoding.ctor/default.pass.cpp | 14 +-
.../text_encoding.ctor/id.pass.cpp | 40 +-
.../text_encoding.ctor/string_view.pass.cpp | 41 +-
.../text_encoding.eq/equal.id.pass.cpp | 22 +-
.../text_encoding.eq/equal.pass.cpp | 31 +-
.../text_encoding.members/aliases.pass.cpp | 8 +-
.../environment.nodiscard.verify.cpp | 30 +
.../environment.pass.cpp | 44 +-
.../text_encoding.members/literal.pass.cpp | 27 +-
.../nodiscard.verify.cpp | 7 +-
.../text_encoding.aliases_view/begin.pass.cpp | 10 +-
.../text_encoding.aliases_view/empty.pass.cpp | 60 +-
.../text_encoding.aliases_view/end.pass.cpp | 37 +
.../text_encoding.aliases_view/front.pass.cpp | 8 +-
.../iterator.pass.cpp | 101 +
libcxx/test/support/test_text_encoding.h | 2324 +++++++++--------
40 files changed, 3223 insertions(+), 2679 deletions(-)
delete mode 100644 libcxx/include/__text_encoding/get_locale_encoding.h
create mode 100644 libcxx/include/__text_encoding/text_encoding_rep.h
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.nodiscard.verify.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/end.pass.cpp
create mode 100644 libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/iterator.pass.cpp
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index fe4f7bbaa45c3..d57d756447e07 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -762,8 +762,8 @@ set(files
__system_error/error_condition.h
__system_error/system_error.h
__system_error/throw_system_error.h
- __text_encoding/get_locale_encoding.h
__text_encoding/text_encoding.h
+ __text_encoding/text_encoding_rep.h
__thread/formatter.h
__thread/id.h
__thread/jthread.h
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index 3c38eedbfca6c..b1a76d27ad22d 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -32,7 +32,8 @@
# include <cstring>
# if _LIBCPP_STD_VER >= 26
-# include <__text_encoding/text_encoding.h>
+# include <__bit/bit_cast.h>
+# include <text_encoding>
# endif
# if _LIBCPP_HAS_WIDE_CHARACTERS
@@ -113,16 +114,7 @@ public:
return std::text_encoding();
}
- auto __encoding_divider = __name.find('.'), __modifier_at = __name.find('@');
- if (__encoding_divider == std::string::npos) {
- return std::text_encoding();
- }
-
- if (__modifier_at == std::string::npos) {
- return std::text_encoding(__name.c_str() + __encoding_divider + 1);
- }
-
- return std::text_encoding({__name.c_str() + __encoding_divider + 1, __modifier_at - 1 - __encoding_divider});
+ return std::bit_cast<std::text_encoding>(std::__text_encoding_rep::__get_locale_encoding(__name.c_str()));
}
# endif // _LIBCPP_STD_VER >= 26
diff --git a/libcxx/include/__locale_dir/locale_base_api/ibm.h b/libcxx/include/__locale_dir/locale_base_api/ibm.h
index a8aa519066fdc..ad02645d03529 100644
--- a/libcxx/include/__locale_dir/locale_base_api/ibm.h
+++ b/libcxx/include/__locale_dir/locale_base_api/ibm.h
@@ -14,14 +14,12 @@
# include <__support/ibm/locale_mgmt_zos.h>
#endif // defined(__MVS__)
+#include <clocale>
+#include <langinfo.h>
#include <locale.h>
#include <stdarg.h>
#include <stdio.h>
-#if __has_include(<langinfo.h>)
-# include <langinfo.h>
-#endif
-
#include "cstdlib"
#if defined(__MVS__)
@@ -109,10 +107,8 @@ _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 2, 0) int vasprintf(char** strp, const char
return str_size;
}
-#if __has_include(<langinfo.h>)
inline _LIBCPP_HIDE_FROM_ABI char* __nl_langinfo_l(int __category_mask, __locale_t __l) {
return ::nl_langinfo_l(__category_mask, __l);
}
-#endif
#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_IBM_H
diff --git a/libcxx/include/__locale_dir/support/bsd_like.h b/libcxx/include/__locale_dir/support/bsd_like.h
index 2ad769d44429d..ea826af6bf924 100644
--- a/libcxx/include/__locale_dir/support/bsd_like.h
+++ b/libcxx/include/__locale_dir/support/bsd_like.h
@@ -23,9 +23,8 @@
# include <wchar.h>
# include <wctype.h>
#endif
-#if __has_include(<langinfo.h>)
-# include <langinfo.h>
-#endif
+
+#include <langinfo.h>
#include <xlocale.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -63,11 +62,9 @@ inline _LIBCPP_HIDE_FROM_ABI char* __setlocale(int __category, char const* __loc
inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) { return ::localeconv_l(__loc); }
-# if __has_include(<langinfo.h>)
inline _LIBCPP_HIDE_FROM_ABI char* __nl_langinfo_l(int __category_mask, __locale_t __l) {
return ::nl_langinfo_l(__category_mask, __l);
}
-# endif
#endif // _LIBCPP_BUILDING_LIBRARY
diff --git a/libcxx/include/__locale_dir/support/linux.h b/libcxx/include/__locale_dir/support/linux.h
index 119cb51b9a309..7ad3fdbbb19af 100644
--- a/libcxx/include/__locale_dir/support/linux.h
+++ b/libcxx/include/__locale_dir/support/linux.h
@@ -17,6 +17,7 @@
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
+#include <langinfo.h>
#include <stdarg.h>
#include <string.h>
#include <time.h>
@@ -24,9 +25,6 @@
# include <cwchar>
# include <wctype.h>
#endif
-#if __has_include(<langinfo.h>)
-# include <langinfo.h>
-#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -81,11 +79,9 @@ inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) {
return std::localeconv();
}
-# if __has_include(<langinfo.h>)
inline _LIBCPP_HIDE_FROM_ABI char* __nl_langinfo_l(int __category_mask, __locale_t __l) {
return ::nl_langinfo_l(__category_mask, __l);
}
-# endif
#endif // _LIBCPP_BUILDING_LIBRARY
diff --git a/libcxx/include/__text_encoding/get_locale_encoding.h b/libcxx/include/__text_encoding/get_locale_encoding.h
deleted file mode 100644
index 9e2a6d7f08d61..0000000000000
--- a/libcxx/include/__text_encoding/get_locale_encoding.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___GET_LOCALE_ENCODING_H
-#define _LIBCPP___GET_LOCALE_ENCODING_H
-
-#include <__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-#if _LIBCPP_HAS_LOCALIZATION
-
-# include <string_view>
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-string_view _LIBCPP_EXPORTED_FROM_ABI __get_locale_encoding(const char* __name);
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP_HAS_LOCALIZATION
-
-#endif // _LIBCPP___GET_LOCALE_ENCODING_H
diff --git a/libcxx/include/__text_encoding/text_encoding.h b/libcxx/include/__text_encoding/text_encoding.h
index 7098549752e39..0e54950606ad7 100644
--- a/libcxx/include/__text_encoding/text_encoding.h
+++ b/libcxx/include/__text_encoding/text_encoding.h
@@ -10,327 +10,44 @@
#ifndef _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_H
#define _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_H
-#include <__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
#include <__algorithm/copy_n.h>
-#include <__algorithm/find.h>
-#include <__algorithm/lower_bound.h>
-#include <__algorithm/min.h>
-#include <__assert>
+#include <__bit/bit_cast.h>
+#include <__config>
+#include <__cstddef/ptrdiff_t.h>
+#include <__cstddef/size_t.h>
#include <__functional/hash.h>
#include <__iterator/iterator_traits.h>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/view_interface.h>
-#include <__string/char_traits.h>
-#include <__text_encoding/get_locale_encoding.h>
-#include <__utility/unreachable.h>
+#include <__text_encoding/text_encoding_rep.h>
#include <cstdint>
#include <string_view>
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
#if _LIBCPP_STD_VER >= 26
+
_LIBCPP_BEGIN_NAMESPACE_STD
struct text_encoding {
static constexpr size_t max_name_length = 63;
-
-private:
- using __id_rep _LIBCPP_NODEBUG = int_least32_t;
- struct __encoding_data {
- const char* __name_;
- __id_rep __mib_rep_;
- uint_least32_t __name_size_;
-
- friend constexpr bool operator==(const __encoding_data& __e, const __encoding_data& __other) noexcept {
- return __e.__mib_rep_ == __other.__mib_rep_ ||
- __comp_name(string_view(__e.__name_, __e.__name_size_), string_view(__other.__name_, __e.__name_size_));
- }
-
- friend constexpr bool operator<(const __encoding_data& __e, const __id_rep __i) noexcept {
- return __e.__mib_rep_ < __i;
- }
-
- friend constexpr bool operator==(const __encoding_data& __e, std::string_view __name) noexcept {
- return __comp_name(__name, string_view(__e.__name_, __e.__name_size_));
- }
- };
-
-public:
- enum class id : __id_rep {
- other = 1,
- unknown = 2,
- ASCII = 3,
- ISOLatin1 = 4,
- ISOLatin2 = 5,
- ISOLatin3 = 6,
- ISOLatin4 = 7,
- ISOLatinCyrillic = 8,
- ISOLatinArabic = 9,
- ISOLatinGreek = 10,
- ISOLatinHebrew = 11,
- ISOLatin5 = 12,
- ISOLatin6 = 13,
- ISOTextComm = 14,
- HalfWidthKatakana = 15,
- JISEncoding = 16,
- ShiftJIS = 17,
- EUCPkdFmtJapanese = 18,
- EUCFixWidJapanese = 19,
- ISO4UnitedKingdom = 20,
- ISO11SwedishForNames = 21,
- ISO15Italian = 22,
- ISO17Spanish = 23,
- ISO21German = 24,
- ISO60DanishNorwegian = 25,
- ISO69French = 26,
- ISO10646UTF1 = 27,
- ISO646basic1983 = 28,
- INVARIANT = 29,
- ISO2IntlRefVersion = 30,
- NATSSEFI = 31,
- NATSSEFIADD = 32,
- ISO10Swedish = 35,
- KSC56011987 = 36,
- ISO2022KR = 37,
- EUCKR = 38,
- ISO2022JP = 39,
- ISO2022JP2 = 40,
- ISO13JISC6220jp = 41,
- ISO14JISC6220ro = 42,
- ISO16Portuguese = 43,
- ISO18Greek7Old = 44,
- ISO19LatinGreek = 45,
- ISO25French = 46,
- ISO27LatinGreek1 = 47,
- ISO5427Cyrillic = 48,
- ISO42JISC62261978 = 49,
- ISO47BSViewdata = 50,
- ISO49INIS = 51,
- ISO50INIS8 = 52,
- ISO51INISCyrillic = 53,
- ISO54271981 = 54,
- ISO5428Greek = 55,
- ISO57GB1988 = 56,
- ISO58GB231280 = 57,
- ISO61Norwegian2 = 58,
- ISO70VideotexSupp1 = 59,
- ISO84Portuguese2 = 60,
- ISO85Spanish2 = 61,
- ISO86Hungarian = 62,
- ISO87JISX0208 = 63,
- ISO88Greek7 = 64,
- ISO89ASMO449 = 65,
- ISO90 = 66,
- ISO91JISC62291984a = 67,
- ISO92JISC62991984b = 68,
- ISO93JIS62291984badd = 69,
- ISO94JIS62291984hand = 70,
- ISO95JIS62291984handadd = 71,
- ISO96JISC62291984kana = 72,
- ISO2033 = 73,
- ISO99NAPLPS = 74,
- ISO102T617bit = 75,
- ISO103T618bit = 76,
- ISO111ECMACyrillic = 77,
- ISO121Canadian1 = 78,
- ISO122Canadian2 = 79,
- ISO123CSAZ24341985gr = 80,
- ISO88596E = 81,
- ISO88596I = 82,
- ISO128T101G2 = 83,
- ISO88598E = 84,
- ISO88598I = 85,
- ISO139CSN369103 = 86,
- ISO141JUSIB1002 = 87,
- ISO143IECP271 = 88,
- ISO146Serbian = 89,
- ISO147Macedonian = 90,
- ISO150 = 91,
- ISO151Cuba = 92,
- ISO6937Add = 93,
- ISO153GOST1976874 = 94,
- ISO8859Supp = 95,
- ISO10367Box = 96,
- ISO158Lap = 97,
- ISO159JISX02121990 = 98,
- ISO646Danish = 99,
- USDK = 100,
- DKUS = 101,
- KSC5636 = 102,
- Unicode11UTF7 = 103,
- ISO2022CN = 104,
- ISO2022CNEXT = 105,
- UTF8 = 106,
- ISO885913 = 109,
- ISO885914 = 110,
- ISO885915 = 111,
- ISO885916 = 112,
- GBK = 113,
- GB18030 = 114,
- OSDEBCDICDF0415 = 115,
- OSDEBCDICDF03IRV = 116,
- OSDEBCDICDF041 = 117,
- ISO115481 = 118,
- KZ1048 = 119,
- UCS2 = 1000,
- UCS4 = 1001,
- UnicodeASCII = 1002,
- UnicodeLatin1 = 1003,
- UnicodeJapanese = 1004,
- UnicodeIBM1261 = 1005,
- UnicodeIBM1268 = 1006,
- UnicodeIBM1276 = 1007,
- UnicodeIBM1264 = 1008,
- UnicodeIBM1265 = 1009,
- Unicode11 = 1010,
- SCSU = 1011,
- UTF7 = 1012,
- UTF16BE = 1013,
- UTF16LE = 1014,
- UTF16 = 1015,
- CESU8 = 1016,
- UTF32 = 1017,
- UTF32BE = 1018,
- UTF32LE = 1019,
- BOCU1 = 1020,
- UTF7IMAP = 1021,
- Windows30Latin1 = 2000,
- Windows31Latin1 = 2001,
- Windows31Latin2 = 2002,
- Windows31Latin5 = 2003,
- HPRoman8 = 2004,
- AdobeStandardEncoding = 2005,
- VenturaUS = 2006,
- VenturaInternational = 2007,
- DECMCS = 2008,
- PC850Multilingual = 2009,
- PC8DanishNorwegian = 2012,
- PC862LatinHebrew = 2013,
- PC8Turkish = 2014,
- IBMSymbols = 2015,
- IBMThai = 2016,
- HPLegal = 2017,
- HPPiFont = 2018,
- HPMath8 = 2019,
- HPPSMath = 2020,
- HPDesktop = 2021,
- VenturaMath = 2022,
- MicrosoftPublishing = 2023,
- Windows31J = 2024,
- GB2312 = 2025,
- Big5 = 2026,
- Macintosh = 2027,
- IBM037 = 2028,
- IBM038 = 2029,
- IBM273 = 2030,
- IBM274 = 2031,
- IBM275 = 2032,
- IBM277 = 2033,
- IBM278 = 2034,
- IBM280 = 2035,
- IBM281 = 2036,
- IBM284 = 2037,
- IBM285 = 2038,
- IBM290 = 2039,
- IBM297 = 2040,
- IBM420 = 2041,
- IBM423 = 2042,
- IBM424 = 2043,
- PC8CodePage437 = 2011,
- IBM500 = 2044,
- IBM851 = 2045,
- PCp852 = 2010,
- IBM855 = 2046,
- IBM857 = 2047,
- IBM860 = 2048,
- IBM861 = 2049,
- IBM863 = 2050,
- IBM864 = 2051,
- IBM865 = 2052,
- IBM868 = 2053,
- IBM869 = 2054,
- IBM870 = 2055,
- IBM871 = 2056,
- IBM880 = 2057,
- IBM891 = 2058,
- IBM903 = 2059,
- IBM904 = 2060,
- IBM905 = 2061,
- IBM918 = 2062,
- IBM1026 = 2063,
- IBMEBCDICATDE = 2064,
- EBCDICATDEA = 2065,
- EBCDICCAFR = 2066,
- EBCDICDKNO = 2067,
- EBCDICDKNOA = 2068,
- EBCDICFISE = 2069,
- EBCDICFISEA = 2070,
- EBCDICFR = 2071,
- EBCDICIT = 2072,
- EBCDICPT = 2073,
- EBCDICES = 2074,
- EBCDICESA = 2075,
- EBCDICESS = 2076,
- EBCDICUK = 2077,
- EBCDICUS = 2078,
- Unknown8BiT = 2079,
- Mnemonic = 2080,
- Mnem = 2081,
- VISCII = 2082,
- VIQR = 2083,
- KOI8R = 2084,
- HZGB2312 = 2085,
- IBM866 = 2086,
- PC775Baltic = 2087,
- KOI8U = 2088,
- IBM00858 = 2089,
- IBM00924 = 2090,
- IBM01140 = 2091,
- IBM01141 = 2092,
- IBM01142 = 2093,
- IBM01143 = 2094,
- IBM01144 = 2095,
- IBM01145 = 2096,
- IBM01146 = 2097,
- IBM01147 = 2098,
- IBM01148 = 2099,
- IBM01149 = 2100,
- Big5HKSCS = 2101,
- IBM1047 = 2102,
- PTCP154 = 2103,
- Amiga1251 = 2104,
- KOI7switched = 2105,
- BRF = 2106,
- TSCII = 2107,
- CP51932 = 2108,
- windows874 = 2109,
- windows1250 = 2250,
- windows1251 = 2251,
- windows1252 = 2252,
- windows1253 = 2253,
- windows1254 = 2254,
- windows1255 = 2255,
- windows1256 = 2256,
- windows1257 = 2257,
- windows1258 = 2258,
- TIS620 = 2259,
- CP50220 = 2260
- };
-
+ using id = std::__text_encoding_rep::__id;
using enum id;
_LIBCPP_HIDE_FROM_ABI constexpr text_encoding() = default;
+
_LIBCPP_HIDE_FROM_ABI constexpr explicit text_encoding(string_view __enc) noexcept
- : __encoding_rep_(__find_encoding_data(__enc)) {
+ : __encoding_rep_(__text_encoding_rep::__find_encoding_data(__enc)) {
__enc.copy(__name_, max_name_length, 0);
}
- _LIBCPP_HIDE_FROM_ABI constexpr text_encoding(id __i) noexcept : __encoding_rep_(__find_encoding_data_by_id(__i)) {
+
+ _LIBCPP_HIDE_FROM_ABI constexpr text_encoding(id __i) noexcept
+ : __encoding_rep_(__text_encoding_rep::__find_encoding_data_by_id(__i)) {
if (__encoding_rep_->__name_[0] != '\0')
std::copy_n(__encoding_rep_->__name_, std::char_traits<char>::length(__encoding_rep_->__name_), __name_);
}
@@ -340,8 +57,6 @@ struct text_encoding {
// [text.encoding.aliases], class text_encoding::aliases_view
struct aliases_view : ranges::view_interface<aliases_view> {
- constexpr aliases_view() = default;
- constexpr aliases_view(const __encoding_data* __d) : __view_data_(__d) {}
struct __end_sentinel {};
struct __iterator {
using value_type = const char*;
@@ -377,7 +92,7 @@ struct text_encoding {
_LIBCPP_HIDE_FROM_ABI constexpr difference_type operator-(const __iterator& __other) const {
_LIBCPP_ASSERT(__other.__mib_rep_ == __mib_rep_, "Subtracting ranges of two different text encodings!");
- return __mib_rep_ - __other.__mib_rep_;
+ return __data_ - __other.__data_;
}
_LIBCPP_HIDE_FROM_ABI friend constexpr __iterator operator-(difference_type __n, __iterator& __it) {
@@ -412,12 +127,13 @@ struct text_encoding {
_LIBCPP_HIDE_FROM_ABI constexpr __iterator& operator+=(difference_type __n) {
if (__data_) {
if (__n > 0) {
- if ((__data_ + __n) < std::end(__text_encoding_data) && __data_[__n - 1].__mib_rep_ == __mib_rep_)
+ if ((__data_ + __n) < std::end(__text_encoding_rep::__text_encoding_data) &&
+ __data_[__n - 1].__mib_rep_ == __mib_rep_)
__data_ += __n;
else
*this = __iterator{};
} else if (__n < 0) {
- if ((__data_ + __n) > __text_encoding_data && __data_[__n].__mib_rep_ == __mib_rep_)
+ if ((__data_ + __n) > __text_encoding_rep::__text_encoding_data && __data_[__n].__mib_rep_ == __mib_rep_)
__data_ += __n;
else
*this = __iterator{};
@@ -437,9 +153,9 @@ struct text_encoding {
_LIBCPP_HIDE_FROM_ABI constexpr auto operator<=>(__iterator __it) const { return __data_ <=> __it.__data_; }
private:
- friend struct text_encoding;
+ friend struct aliases_view;
- _LIBCPP_HIDE_FROM_ABI constexpr __iterator(const __encoding_data* __enc_d) noexcept
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator(const __text_encoding_rep::__encoding_data* __enc_d) noexcept
: __data_(__enc_d), __mib_rep_(__enc_d ? __enc_d->__mib_rep_ : 0) {}
_LIBCPP_HIDE_FROM_ABI constexpr bool __can_dereference() const {
@@ -447,27 +163,27 @@ struct text_encoding {
}
// default iterator is a sentinel
- const __encoding_data* __data_ = nullptr;
- __id_rep __mib_rep_ = 0;
+ const __text_encoding_rep::__encoding_data* __data_ = nullptr;
+ __text_encoding_rep::__id_rep __mib_rep_ = 0;
};
- constexpr __iterator begin() const { return __iterator{__view_data_}; }
- constexpr __end_sentinel end() const { return __end_sentinel{}; }
+ _LIBCPP_HIDE_FROM_ABI constexpr __iterator begin() const { return __iterator{__view_data_}; }
+ _LIBCPP_HIDE_FROM_ABI constexpr __end_sentinel end() const { return __end_sentinel{}; }
private:
- const __encoding_data* __view_data_ = nullptr;
+ friend struct text_encoding;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr aliases_view(const __text_encoding_rep::__encoding_data* __d) : __view_data_(__d) {}
+ const __text_encoding_rep::__encoding_data* __view_data_ = nullptr;
};
- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr aliases_view aliases() const noexcept {
- if (!__encoding_rep_->__name_[0])
- return aliases_view(nullptr);
- return aliases_view(__encoding_rep_);
+ [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr aliases_view aliases() const {
+ return __encoding_rep_->__name_[0] ? aliases_view(__encoding_rep_) : aliases_view(nullptr);
}
_LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const text_encoding& __a, const text_encoding& __b) noexcept {
if (__a.mib() == id::other && __b.mib() == id::other)
- return __comp_name(__a.__name_, __b.__name_);
-
+ return __text_encoding_rep::__comp_name(__a.__name_, __b.__name_);
return __a.mib() == __b.mib();
}
@@ -488,7 +204,7 @@ struct text_encoding {
# if _LIBCPP_HAS_LOCALIZATION
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI static text_encoding environment() {
- return text_encoding(__get_locale_encoding(""));
+ return std::bit_cast<text_encoding>(__text_encoding_rep::__get_locale_encoding(""));
}
template <id __i>
@@ -501,967 +217,19 @@ struct text_encoding {
# endif // _LIBCPP_HAS_LOCALIZATION
private:
- _LIBCPP_HIDE_FROM_ABI static constexpr bool __comp_name(string_view __a, string_view __b) {
- if (__a.empty() || __b.empty()) {
- return false;
- }
-
- // map any non-alphanumeric character to 255, skip prefix 0s, else get tolower(__n)
- auto __map_char = [](char __n, bool& __in_number) -> unsigned char {
- auto __to_lower = [](char __n) -> char { return (__n >= 'A' && __n <= 'Z') ? __n + ('a' - 'A') : __n; };
- if (__n == '0') {
- return __in_number ? '0' : 255;
- }
- __in_number = __n >= '1' && __n <= '9';
- return (__n >= '1' && __n <= '9') || (__n >= 'A' && __n <= 'Z') || (__n >= 'a' && __n <= 'z')
- ? __to_lower(__n)
- : 255;
- };
-
- auto __a_ptr = __a.begin(), __b_ptr = __b.begin();
- bool __a_in_number = false, __b_in_number = false;
-
- unsigned char __a_val = 255, __b_val = 255;
- for (;; __a_ptr++, __b_ptr++) {
- while ((__a_val = __map_char(*__a_ptr, __a_in_number)) == 255 && __a_ptr != __a.end())
- __a_ptr++;
- while ((__b_val = __map_char(*__b_ptr, __b_in_number)) == 255 && __b_ptr != __b.end())
- __b_ptr++;
-
- if (__a_ptr == __a.end())
- return __b_ptr == __b.end();
- if (__b_ptr == __b.end())
- return false;
- if (__a_val != __b_val)
- return false;
- }
- return true;
- }
-
- _LIBCPP_HIDE_FROM_ABI static constexpr const __encoding_data* __find_encoding_data(string_view __a) {
- _LIBCPP_ASSERT(__a.size() <= max_name_length, "Passing encoding name longer than max_name_length!");
- auto __data_ptr = __text_encoding_data + 2, __data_last = std::end(__text_encoding_data);
- auto __found_data = std::find(__data_ptr, __data_last, __a);
-
- if (__found_data == __data_last) {
- return __text_encoding_data; // other
- }
-
- while (__found_data[-1].__mib_rep_ == __found_data->__mib_rep_) {
- __found_data--;
- }
-
- return __found_data;
- }
-
- _LIBCPP_HIDE_FROM_ABI static constexpr const __encoding_data* __find_encoding_data_by_id(id __i) {
- _LIBCPP_ASSERT(__i >= id::other && __i <= id::CP50220 && __id_rep(__i) != 33 && __id_rep(__i) != 34,
- "Passing invalid id to text_encoding constructor!");
- auto __found = std::lower_bound(std::begin(__text_encoding_data), std::end(__text_encoding_data), __id_rep(__i));
- return __found != std::end(__text_encoding_data)
- ? __found
- : __text_encoding_data + 1; // unknown, should be unreachable
- }
-
- _LIBCPP_HIDE_FROM_ABI static constexpr __encoding_data __text_encoding_data[] = {
- {"", 1, 0},
- {"", 2, 0},
- {"US-ASCII", 3, 8},
- {"iso-ir-6", 3, 8},
- {"ANSI_X3.4-1968", 3, 14},
- {"ANSI_X3.4-1986", 3, 14},
- {"ISO_646.irv:1991", 3, 16},
- {"ISO646-US", 3, 9},
- {"us", 3, 2},
- {"IBM367", 3, 6},
- {"cp367", 3, 5},
- {"csASCII", 3, 7},
- {"ASCII", 3, 5},
- {"ISO_8859-1:1987", 4, 15},
- {"iso-ir-100", 4, 10},
- {"ISO_8859-1", 4, 10},
- {"ISO-8859-1", 4, 10},
- {"latin1", 4, 6},
- {"l1", 4, 2},
- {"IBM819", 4, 6},
- {"CP819", 4, 5},
- {"csISOLatin1", 4, 11},
- {"ISO_8859-2:1987", 5, 15},
- {"iso-ir-101", 5, 10},
- {"ISO_8859-2", 5, 10},
- {"ISO-8859-2", 5, 10},
- {"latin2", 5, 6},
- {"l2", 5, 2},
- {"csISOLatin2", 5, 11},
- {"ISO_8859-3:1988", 6, 15},
- {"iso-ir-109", 6, 10},
- {"ISO_8859-3", 6, 10},
- {"ISO-8859-3", 6, 10},
- {"latin3", 6, 6},
- {"l3", 6, 2},
- {"csISOLatin3", 6, 11},
- {"ISO_8859-4:1988", 7, 15},
- {"iso-ir-110", 7, 10},
- {"ISO_8859-4", 7, 10},
- {"ISO-8859-4", 7, 10},
- {"latin4", 7, 6},
- {"l4", 7, 2},
- {"csISOLatin4", 7, 11},
- {"ISO_8859-5:1988", 8, 15},
- {"iso-ir-144", 8, 10},
- {"ISO_8859-5", 8, 10},
- {"ISO-8859-5", 8, 10},
- {"cyrillic", 8, 8},
- {"csISOLatinCyrillic", 8, 18},
- {"ISO_8859-6:1987", 9, 15},
- {"iso-ir-127", 9, 10},
- {"ISO_8859-6", 9, 10},
- {"ISO-8859-6", 9, 10},
- {"ECMA-114", 9, 8},
- {"ASMO-708", 9, 8},
- {"arabic", 9, 6},
- {"csISOLatinArabic", 9, 16},
- {"ISO_8859-7:1987", 10, 15},
- {"iso-ir-126", 10, 10},
- {"ISO_8859-7", 10, 10},
- {"ISO-8859-7", 10, 10},
- {"ELOT_928", 10, 8},
- {"ECMA-118", 10, 8},
- {"greek", 10, 5},
- {"greek8", 10, 6},
- {"csISOLatinGreek", 10, 15},
- {"ISO_8859-8:1988", 11, 15},
- {"iso-ir-138", 11, 10},
- {"ISO_8859-8", 11, 10},
- {"ISO-8859-8", 11, 10},
- {"hebrew", 11, 6},
- {"csISOLatinHebrew", 11, 16},
- {"ISO_8859-9:1989", 12, 15},
- {"iso-ir-148", 12, 10},
- {"ISO_8859-9", 12, 10},
- {"ISO-8859-9", 12, 10},
- {"latin5", 12, 6},
- {"l5", 12, 2},
- {"csISOLatin5", 12, 11},
- {"ISO-8859-10", 13, 11},
- {"iso-ir-157", 13, 10},
- {"l6", 13, 2},
- {"ISO_8859-10:1992", 13, 16},
- {"csISOLatin6", 13, 11},
- {"latin6", 13, 6},
- {"ISO_6937-2-add", 14, 14},
- {"iso-ir-142", 14, 10},
- {"csISOTextComm", 14, 13},
- {"JIS_X0201", 15, 9},
- {"X0201", 15, 5},
- {"csHalfWidthKatakana", 15, 19},
- {"JIS_Encoding", 16, 12},
- {"csJISEncoding", 16, 13},
- {"Shift_JIS", 17, 9},
- {"MS_Kanji", 17, 8},
- {"csShiftJIS", 17, 10},
- {"Extended_UNIX_Code_Packed_Format_for_Japanese", 18, 45},
- {"csEUCPkdFmtJapanese", 18, 19},
- {"EUC-JP", 18, 6},
- {"Extended_UNIX_Code_Fixed_Width_for_Japanese", 19, 43},
- {"csEUCFixWidJapanese", 19, 19},
- {"BS_4730", 20, 7},
- {"iso-ir-4", 20, 8},
- {"ISO646-GB", 20, 9},
- {"gb", 20, 2},
- {"uk", 20, 2},
- {"csISO4UnitedKingdom", 20, 19},
- {"SEN_850200_C", 21, 12},
- {"iso-ir-11", 21, 9},
- {"ISO646-SE2", 21, 10},
- {"se2", 21, 3},
- {"csISO11SwedishForNames", 21, 22},
- {"IT", 22, 2},
- {"iso-ir-15", 22, 9},
- {"ISO646-IT", 22, 9},
- {"csISO15Italian", 22, 14},
- {"ES", 23, 2},
- {"iso-ir-17", 23, 9},
- {"ISO646-ES", 23, 9},
- {"csISO17Spanish", 23, 14},
- {"DIN_66003", 24, 9},
- {"iso-ir-21", 24, 9},
- {"de", 24, 2},
- {"ISO646-DE", 24, 9},
- {"csISO21German", 24, 13},
- {"NS_4551-1", 25, 9},
- {"iso-ir-60", 25, 9},
- {"ISO646-NO", 25, 9},
- {"no", 25, 2},
- {"csISO60DanishNorwegian", 25, 22},
- {"csISO60Norwegian1", 25, 17},
- {"NF_Z_62-010", 26, 11},
- {"iso-ir-69", 26, 9},
- {"ISO646-FR", 26, 9},
- {"fr", 26, 2},
- {"csISO69French", 26, 13},
- {"ISO-10646-UTF-1", 27, 15},
- {"csISO10646UTF1", 27, 14},
- {"ISO_646.basic:1983", 28, 18},
- {"ref", 28, 3},
- {"csISO646basic1983", 28, 17},
- {"INVARIANT", 29, 9},
- {"csINVARIANT", 29, 11},
- {"ISO_646.irv:1983", 30, 16},
- {"iso-ir-2", 30, 8},
- {"irv", 30, 3},
- {"csISO2IntlRefVersion", 30, 20},
- {"NATS-SEFI", 31, 9},
- {"iso-ir-8-1", 31, 10},
- {"csNATSSEFI", 31, 10},
- {"NATS-SEFI-ADD", 32, 13},
- {"iso-ir-8-2", 32, 10},
- {"csNATSSEFIADD", 32, 13},
- {"SEN_850200_B", 35, 12},
- {"iso-ir-10", 35, 9},
- {"FI", 35, 2},
- {"ISO646-FI", 35, 9},
- {"ISO646-SE", 35, 9},
- {"se", 35, 2},
- {"csISO10Swedish", 35, 14},
- {"KS_C_5601-1987", 36, 14},
- {"iso-ir-149", 36, 10},
- {"KS_C_5601-1989", 36, 14},
- {"KSC_5601", 36, 8},
- {"korean", 36, 6},
- {"csKSC56011987", 36, 13},
- {"ISO-2022-KR", 37, 11},
- {"csISO2022KR", 37, 11},
- {"EUC-KR", 38, 6},
- {"csEUCKR", 38, 7},
- {"ISO-2022-JP", 39, 11},
- {"csISO2022JP", 39, 11},
- {"ISO-2022-JP-2", 40, 13},
- {"csISO2022JP2", 40, 12},
- {"JIS_C6220-1969-jp", 41, 17},
- {"JIS_C6220-1969", 41, 14},
- {"iso-ir-13", 41, 9},
- {"katakana", 41, 8},
- {"x0201-7", 41, 7},
- {"csISO13JISC6220jp", 41, 17},
- {"JIS_C6220-1969-ro", 42, 17},
- {"iso-ir-14", 42, 9},
- {"jp", 42, 2},
- {"ISO646-JP", 42, 9},
- {"csISO14JISC6220ro", 42, 17},
- {"PT", 43, 2},
- {"iso-ir-16", 43, 9},
- {"ISO646-PT", 43, 9},
- {"csISO16Portuguese", 43, 17},
- {"greek7-old", 44, 10},
- {"iso-ir-18", 44, 9},
- {"csISO18Greek7Old", 44, 16},
- {"latin-greek", 45, 11},
- {"iso-ir-19", 45, 9},
- {"csISO19LatinGreek", 45, 17},
- {"NF_Z_62-010_(1973)", 46, 18},
- {"iso-ir-25", 46, 9},
- {"ISO646-FR1", 46, 10},
- {"csISO25French", 46, 13},
- {"Latin-greek-1", 47, 13},
- {"iso-ir-27", 47, 9},
- {"csISO27LatinGreek1", 47, 18},
- {"ISO_5427", 48, 8},
- {"iso-ir-37", 48, 9},
- {"csISO5427Cyrillic", 48, 17},
- {"JIS_C6226-1978", 49, 14},
- {"iso-ir-42", 49, 9},
- {"csISO42JISC62261978", 49, 19},
- {"BS_viewdata", 50, 11},
- {"iso-ir-47", 50, 9},
- {"csISO47BSViewdata", 50, 17},
- {"INIS", 51, 4},
- {"iso-ir-49", 51, 9},
- {"csISO49INIS", 51, 11},
- {"INIS-8", 52, 6},
- {"iso-ir-50", 52, 9},
- {"csISO50INIS8", 52, 12},
- {"INIS-cyrillic", 53, 13},
- {"iso-ir-51", 53, 9},
- {"csISO51INISCyrillic", 53, 19},
- {"ISO_5427:1981", 54, 13},
- {"iso-ir-54", 54, 9},
- {"ISO5427Cyrillic1981", 54, 19},
- {"csISO54271981", 54, 13},
- {"ISO_5428:1980", 55, 13},
- {"iso-ir-55", 55, 9},
- {"csISO5428Greek", 55, 14},
- {"GB_1988-80", 56, 10},
- {"iso-ir-57", 56, 9},
- {"cn", 56, 2},
- {"ISO646-CN", 56, 9},
- {"csISO57GB1988", 56, 13},
- {"GB_2312-80", 57, 10},
- {"iso-ir-58", 57, 9},
- {"chinese", 57, 7},
- {"csISO58GB231280", 57, 15},
- {"NS_4551-2", 58, 9},
- {"ISO646-NO2", 58, 10},
- {"iso-ir-61", 58, 9},
- {"no2", 58, 3},
- {"csISO61Norwegian2", 58, 17},
- {"videotex-suppl", 59, 14},
- {"iso-ir-70", 59, 9},
- {"csISO70VideotexSupp1", 59, 20},
- {"PT2", 60, 3},
- {"iso-ir-84", 60, 9},
- {"ISO646-PT2", 60, 10},
- {"csISO84Portuguese2", 60, 18},
- {"ES2", 61, 3},
- {"iso-ir-85", 61, 9},
- {"ISO646-ES2", 61, 10},
- {"csISO85Spanish2", 61, 15},
- {"MSZ_7795.3", 62, 10},
- {"iso-ir-86", 62, 9},
- {"ISO646-HU", 62, 9},
- {"hu", 62, 2},
- {"csISO86Hungarian", 62, 16},
- {"JIS_C6226-1983", 63, 14},
- {"iso-ir-87", 63, 9},
- {"x0208", 63, 5},
- {"JIS_X0208-1983", 63, 14},
- {"csISO87JISX0208", 63, 15},
- {"greek7", 64, 6},
- {"iso-ir-88", 64, 9},
- {"csISO88Greek7", 64, 13},
- {"ASMO_449", 65, 8},
- {"ISO_9036", 65, 8},
- {"arabic7", 65, 7},
- {"iso-ir-89", 65, 9},
- {"csISO89ASMO449", 65, 14},
- {"iso-ir-90", 66, 9},
- {"csISO90", 66, 7},
- {"JIS_C6229-1984-a", 67, 16},
- {"iso-ir-91", 67, 9},
- {"jp-ocr-a", 67, 8},
- {"csISO91JISC62291984a", 67, 20},
- {"JIS_C6229-1984-b", 68, 16},
- {"iso-ir-92", 68, 9},
- {"ISO646-JP-OCR-B", 68, 15},
- {"jp-ocr-b", 68, 8},
- {"csISO92JISC62991984b", 68, 20},
- {"JIS_C6229-1984-b-add", 69, 20},
- {"iso-ir-93", 69, 9},
- {"jp-ocr-b-add", 69, 12},
- {"csISO93JIS62291984badd", 69, 22},
- {"JIS_C6229-1984-hand", 70, 19},
- {"iso-ir-94", 70, 9},
- {"jp-ocr-hand", 70, 11},
- {"csISO94JIS62291984hand", 70, 22},
- {"JIS_C6229-1984-hand-add", 71, 23},
- {"iso-ir-95", 71, 9},
- {"jp-ocr-hand-add", 71, 15},
- {"csISO95JIS62291984handadd", 71, 25},
- {"JIS_C6229-1984-kana", 72, 19},
- {"iso-ir-96", 72, 9},
- {"csISO96JISC62291984kana", 72, 23},
- {"ISO_2033-1983", 73, 13},
- {"iso-ir-98", 73, 9},
- {"e13b", 73, 4},
- {"csISO2033", 73, 9},
- {"ANSI_X3.110-1983", 74, 16},
- {"iso-ir-99", 74, 9},
- {"CSA_T500-1983", 74, 13},
- {"NAPLPS", 74, 6},
- {"csISO99NAPLPS", 74, 13},
- {"T.61-7bit", 75, 9},
- {"iso-ir-102", 75, 10},
- {"csISO102T617bit", 75, 15},
- {"T.61-8bit", 76, 9},
- {"T.61", 76, 4},
- {"iso-ir-103", 76, 10},
- {"csISO103T618bit", 76, 15},
- {"ECMA-cyrillic", 77, 13},
- {"iso-ir-111", 77, 10},
- {"KOI8-E", 77, 6},
- {"csISO111ECMACyrillic", 77, 20},
- {"CSA_Z243.4-1985-1", 78, 17},
- {"iso-ir-121", 78, 10},
- {"ISO646-CA", 78, 9},
- {"csa7-1", 78, 6},
- {"csa71", 78, 5},
- {"ca", 78, 2},
- {"csISO121Canadian1", 78, 17},
- {"CSA_Z243.4-1985-2", 79, 17},
- {"iso-ir-122", 79, 10},
- {"ISO646-CA2", 79, 10},
- {"csa7-2", 79, 6},
- {"csa72", 79, 5},
- {"csISO122Canadian2", 79, 17},
- {"CSA_Z243.4-1985-gr", 80, 18},
- {"iso-ir-123", 80, 10},
- {"csISO123CSAZ24341985gr", 80, 22},
- {"ISO_8859-6-E", 81, 12},
- {"csISO88596E", 81, 11},
- {"ISO-8859-6-E", 81, 12},
- {"ISO_8859-6-I", 82, 12},
- {"csISO88596I", 82, 11},
- {"ISO-8859-6-I", 82, 12},
- {"T.101-G2", 83, 8},
- {"iso-ir-128", 83, 10},
- {"csISO128T101G2", 83, 14},
- {"ISO_8859-8-E", 84, 12},
- {"csISO88598E", 84, 11},
- {"ISO-8859-8-E", 84, 12},
- {"ISO_8859-8-I", 85, 12},
- {"csISO88598I", 85, 11},
- {"ISO-8859-8-I", 85, 12},
- {"CSN_369103", 86, 10},
- {"iso-ir-139", 86, 10},
- {"csISO139CSN369103", 86, 17},
- {"JUS_I.B1.002", 87, 12},
- {"iso-ir-141", 87, 10},
- {"ISO646-YU", 87, 9},
- {"js", 87, 2},
- {"yu", 87, 2},
- {"csISO141JUSIB1002", 87, 17},
- {"IEC_P27-1", 88, 9},
- {"iso-ir-143", 88, 10},
- {"csISO143IECP271", 88, 15},
- {"JUS_I.B1.003-serb", 89, 17},
- {"iso-ir-146", 89, 10},
- {"serbian", 89, 7},
- {"csISO146Serbian", 89, 15},
- {"JUS_I.B1.003-mac", 90, 16},
- {"macedonian", 90, 10},
- {"iso-ir-147", 90, 10},
- {"csISO147Macedonian", 90, 18},
- {"greek-ccitt", 91, 11},
- {"iso-ir-150", 91, 10},
- {"csISO150", 91, 8},
- {"csISO150GreekCCITT", 91, 18},
- {"NC_NC00-10:81", 92, 13},
- {"cuba", 92, 4},
- {"iso-ir-151", 92, 10},
- {"ISO646-CU", 92, 9},
- {"csISO151Cuba", 92, 12},
- {"ISO_6937-2-25", 93, 13},
- {"iso-ir-152", 93, 10},
- {"csISO6937Add", 93, 12},
- {"GOST_19768-74", 94, 13},
- {"ST_SEV_358-88", 94, 13},
- {"iso-ir-153", 94, 10},
- {"csISO153GOST1976874", 94, 19},
- {"ISO_8859-supp", 95, 13},
- {"iso-ir-154", 95, 10},
- {"latin1-2-5", 95, 10},
- {"csISO8859Supp", 95, 13},
- {"ISO_10367-box", 96, 13},
- {"iso-ir-155", 96, 10},
- {"csISO10367Box", 96, 13},
- {"latin-lap", 97, 9},
- {"lap", 97, 3},
- {"iso-ir-158", 97, 10},
- {"csISO158Lap", 97, 11},
- {"JIS_X0212-1990", 98, 14},
- {"x0212", 98, 5},
- {"iso-ir-159", 98, 10},
- {"csISO159JISX02121990", 98, 20},
- {"DS_2089", 99, 7},
- {"DS2089", 99, 6},
- {"ISO646-DK", 99, 9},
- {"dk", 99, 2},
- {"csISO646Danish", 99, 14},
- {"us-dk", 100, 5},
- {"csUSDK", 100, 6},
- {"dk-us", 101, 5},
- {"csDKUS", 101, 6},
- {"KSC5636", 102, 7},
- {"ISO646-KR", 102, 9},
- {"csKSC5636", 102, 9},
- {"UNICODE-1-1-UTF-7", 103, 17},
- {"csUnicode11UTF7", 103, 15},
- {"ISO-2022-CN", 104, 11},
- {"csISO2022CN", 104, 11},
- {"ISO-2022-CN-EXT", 105, 15},
- {"csISO2022CNEXT", 105, 14},
- {"UTF-8", 106, 5},
- {"csUTF8", 106, 6},
- {"ISO-8859-13", 109, 11},
- {"csISO885913", 109, 11},
- {"ISO-8859-14", 110, 11},
- {"iso-ir-199", 110, 10},
- {"ISO_8859-14:1998", 110, 16},
- {"ISO_8859-14", 110, 11},
- {"latin8", 110, 6},
- {"iso-celtic", 110, 10},
- {"l8", 110, 2},
- {"csISO885914", 110, 11},
- {"ISO-8859-15", 111, 11},
- {"ISO_8859-15", 111, 11},
- {"Latin-9", 111, 7},
- {"csISO885915", 111, 11},
- {"ISO-8859-16", 112, 11},
- {"iso-ir-226", 112, 10},
- {"ISO_8859-16:2001", 112, 16},
- {"ISO_8859-16", 112, 11},
- {"latin10", 112, 7},
- {"l10", 112, 3},
- {"csISO885916", 112, 11},
- {"GBK", 113, 3},
- {"CP936", 113, 5},
- {"MS936", 113, 5},
- {"windows-936", 113, 11},
- {"csGBK", 113, 5},
- {"GB18030", 114, 7},
- {"csGB18030", 114, 9},
- {"OSD_EBCDIC_DF04_15", 115, 18},
- {"csOSDEBCDICDF0415", 115, 17},
- {"OSD_EBCDIC_DF03_IRV", 116, 19},
- {"csOSDEBCDICDF03IRV", 116, 18},
- {"OSD_EBCDIC_DF04_1", 117, 17},
- {"csOSDEBCDICDF041", 117, 16},
- {"ISO-11548-1", 118, 11},
- {"ISO_11548-1", 118, 11},
- {"ISO_TR_11548-1", 118, 14},
- {"csISO115481", 118, 11},
- {"KZ-1048", 119, 7},
- {"STRK1048-2002", 119, 13},
- {"RK1048", 119, 6},
- {"csKZ1048", 119, 8},
- {"ISO-10646-UCS-2", 1000, 15},
- {"csUnicode", 1000, 9},
- {"ISO-10646-UCS-4", 1001, 15},
- {"csUCS4", 1001, 6},
- {"ISO-10646-UCS-Basic", 1002, 19},
- {"csUnicodeASCII", 1002, 14},
- {"ISO-10646-Unicode-Latin1", 1003, 24},
- {"csUnicodeLatin1", 1003, 15},
- {"ISO-10646", 1003, 9},
- {"ISO-10646-J-1", 1004, 13},
- {"csUnicodeJapanese", 1004, 17},
- {"ISO-Unicode-IBM-1261", 1005, 20},
- {"csUnicodeIBM1261", 1005, 16},
- {"ISO-Unicode-IBM-1268", 1006, 20},
- {"csUnicodeIBM1268", 1006, 16},
- {"ISO-Unicode-IBM-1276", 1007, 20},
- {"csUnicodeIBM1276", 1007, 16},
- {"ISO-Unicode-IBM-1264", 1008, 20},
- {"csUnicodeIBM1264", 1008, 16},
- {"ISO-Unicode-IBM-1265", 1009, 20},
- {"csUnicodeIBM1265", 1009, 16},
- {"UNICODE-1-1", 1010, 11},
- {"csUnicode11", 1010, 11},
- {"SCSU", 1011, 4},
- {"csSCSU", 1011, 6},
- {"UTF-7", 1012, 5},
- {"csUTF7", 1012, 6},
- {"UTF-16BE", 1013, 8},
- {"csUTF16BE", 1013, 9},
- {"UTF-16LE", 1014, 8},
- {"csUTF16LE", 1014, 9},
- {"UTF-16", 1015, 6},
- {"csUTF16", 1015, 7},
- {"CESU-8", 1016, 6},
- {"csCESU8", 1016, 7},
- {"csCESU-8", 1016, 8},
- {"UTF-32", 1017, 6},
- {"csUTF32", 1017, 7},
- {"UTF-32BE", 1018, 8},
- {"csUTF32BE", 1018, 9},
- {"UTF-32LE", 1019, 8},
- {"csUTF32LE", 1019, 9},
- {"BOCU-1", 1020, 6},
- {"csBOCU1", 1020, 7},
- {"csBOCU-1", 1020, 8},
- {"UTF-7-IMAP", 1021, 10},
- {"csUTF7IMAP", 1021, 10},
- {"ISO-8859-1-Windows-3.0-Latin-1", 2000, 30},
- {"csWindows30Latin1", 2000, 17},
- {"ISO-8859-1-Windows-3.1-Latin-1", 2001, 30},
- {"csWindows31Latin1", 2001, 17},
- {"ISO-8859-2-Windows-Latin-2", 2002, 26},
- {"csWindows31Latin2", 2002, 17},
- {"ISO-8859-9-Windows-Latin-5", 2003, 26},
- {"csWindows31Latin5", 2003, 17},
- {"hp-roman8", 2004, 9},
- {"roman8", 2004, 6},
- {"r8", 2004, 2},
- {"csHPRoman8", 2004, 10},
- {"Adobe-Standard-Encoding", 2005, 23},
- {"csAdobeStandardEncoding", 2005, 23},
- {"Ventura-US", 2006, 10},
- {"csVenturaUS", 2006, 11},
- {"Ventura-International", 2007, 21},
- {"csVenturaInternational", 2007, 22},
- {"DEC-MCS", 2008, 7},
- {"dec", 2008, 3},
- {"csDECMCS", 2008, 8},
- {"IBM850", 2009, 6},
- {"cp850", 2009, 5},
- {"850", 2009, 3},
- {"csPC850Multilingual", 2009, 19},
- {"IBM852", 2010, 6},
- {"cp852", 2010, 5},
- {"852", 2010, 3},
- {"csPCp852", 2010, 8},
- {"IBM437", 2011, 6},
- {"cp437", 2011, 5},
- {"437", 2011, 3},
- {"csPC8CodePage437", 2011, 16},
- {"PC8-Danish-Norwegian", 2012, 20},
- {"csPC8DanishNorwegian", 2012, 20},
- {"IBM862", 2013, 6},
- {"cp862", 2013, 5},
- {"862", 2013, 3},
- {"csPC862LatinHebrew", 2013, 18},
- {"PC8-Turkish", 2014, 11},
- {"csPC8Turkish", 2014, 12},
- {"IBM-Symbols", 2015, 11},
- {"csIBMSymbols", 2015, 12},
- {"IBM-Thai", 2016, 8},
- {"csIBMThai", 2016, 9},
- {"HP-Legal", 2017, 8},
- {"csHPLegal", 2017, 9},
- {"HP-Pi-font", 2018, 10},
- {"csHPPiFont", 2018, 10},
- {"HP-Math8", 2019, 8},
- {"csHPMath8", 2019, 9},
- {"Adobe-Symbol-Encoding", 2020, 21},
- {"csHPPSMath", 2020, 10},
- {"HP-DeskTop", 2021, 10},
- {"csHPDesktop", 2021, 11},
- {"Ventura-Math", 2022, 12},
- {"csVenturaMath", 2022, 13},
- {"Microsoft-Publishing", 2023, 20},
- {"csMicrosoftPublishing", 2023, 21},
- {"Windows-31J", 2024, 11},
- {"csWindows31J", 2024, 12},
- {"GB2312", 2025, 6},
- {"csGB2312", 2025, 8},
- {"Big5", 2026, 4},
- {"csBig5", 2026, 6},
- {"macintosh", 2027, 9},
- {"mac", 2027, 3},
- {"csMacintosh", 2027, 11},
- {"IBM037", 2028, 6},
- {"cp037", 2028, 5},
- {"ebcdic-cp-us", 2028, 12},
- {"ebcdic-cp-ca", 2028, 12},
- {"ebcdic-cp-wt", 2028, 12},
- {"ebcdic-cp-nl", 2028, 12},
- {"csIBM037", 2028, 8},
- {"IBM038", 2029, 6},
- {"EBCDIC-INT", 2029, 10},
- {"cp038", 2029, 5},
- {"csIBM038", 2029, 8},
- {"IBM273", 2030, 6},
- {"CP273", 2030, 5},
- {"csIBM273", 2030, 8},
- {"IBM274", 2031, 6},
- {"EBCDIC-BE", 2031, 9},
- {"CP274", 2031, 5},
- {"csIBM274", 2031, 8},
- {"IBM275", 2032, 6},
- {"EBCDIC-BR", 2032, 9},
- {"cp275", 2032, 5},
- {"csIBM275", 2032, 8},
- {"IBM277", 2033, 6},
- {"EBCDIC-CP-DK", 2033, 12},
- {"EBCDIC-CP-NO", 2033, 12},
- {"csIBM277", 2033, 8},
- {"IBM278", 2034, 6},
- {"CP278", 2034, 5},
- {"ebcdic-cp-fi", 2034, 12},
- {"ebcdic-cp-se", 2034, 12},
- {"csIBM278", 2034, 8},
- {"IBM280", 2035, 6},
- {"CP280", 2035, 5},
- {"ebcdic-cp-it", 2035, 12},
- {"csIBM280", 2035, 8},
- {"IBM281", 2036, 6},
- {"EBCDIC-JP-E", 2036, 11},
- {"cp281", 2036, 5},
- {"csIBM281", 2036, 8},
- {"IBM284", 2037, 6},
- {"CP284", 2037, 5},
- {"ebcdic-cp-es", 2037, 12},
- {"csIBM284", 2037, 8},
- {"IBM285", 2038, 6},
- {"CP285", 2038, 5},
- {"ebcdic-cp-gb", 2038, 12},
- {"csIBM285", 2038, 8},
- {"IBM290", 2039, 6},
- {"cp290", 2039, 5},
- {"EBCDIC-JP-kana", 2039, 14},
- {"csIBM290", 2039, 8},
- {"IBM297", 2040, 6},
- {"cp297", 2040, 5},
- {"ebcdic-cp-fr", 2040, 12},
- {"csIBM297", 2040, 8},
- {"IBM420", 2041, 6},
- {"cp420", 2041, 5},
- {"ebcdic-cp-ar1", 2041, 13},
- {"csIBM420", 2041, 8},
- {"IBM423", 2042, 6},
- {"cp423", 2042, 5},
- {"ebcdic-cp-gr", 2042, 12},
- {"csIBM423", 2042, 8},
- {"IBM424", 2043, 6},
- {"cp424", 2043, 5},
- {"ebcdic-cp-he", 2043, 12},
- {"csIBM424", 2043, 8},
- {"IBM500", 2044, 6},
- {"CP500", 2044, 5},
- {"ebcdic-cp-be", 2044, 12},
- {"ebcdic-cp-ch", 2044, 12},
- {"csIBM500", 2044, 8},
- {"IBM851", 2045, 6},
- {"cp851", 2045, 5},
- {"851", 2045, 3},
- {"csIBM851", 2045, 8},
- {"IBM855", 2046, 6},
- {"cp855", 2046, 5},
- {"855", 2046, 3},
- {"csIBM855", 2046, 8},
- {"IBM857", 2047, 6},
- {"cp857", 2047, 5},
- {"857", 2047, 3},
- {"csIBM857", 2047, 8},
- {"IBM860", 2048, 6},
- {"cp860", 2048, 5},
- {"860", 2048, 3},
- {"csIBM860", 2048, 8},
- {"IBM861", 2049, 6},
- {"cp861", 2049, 5},
- {"861", 2049, 3},
- {"cp-is", 2049, 5},
- {"csIBM861", 2049, 8},
- {"IBM863", 2050, 6},
- {"cp863", 2050, 5},
- {"863", 2050, 3},
- {"csIBM863", 2050, 8},
- {"IBM864", 2051, 6},
- {"cp864", 2051, 5},
- {"csIBM864", 2051, 8},
- {"IBM865", 2052, 6},
- {"cp865", 2052, 5},
- {"865", 2052, 3},
- {"csIBM865", 2052, 8},
- {"IBM868", 2053, 6},
- {"CP868", 2053, 5},
- {"cp-ar", 2053, 5},
- {"csIBM868", 2053, 8},
- {"IBM869", 2054, 6},
- {"cp869", 2054, 5},
- {"869", 2054, 3},
- {"cp-gr", 2054, 5},
- {"csIBM869", 2054, 8},
- {"IBM870", 2055, 6},
- {"CP870", 2055, 5},
- {"ebcdic-cp-roece", 2055, 15},
- {"ebcdic-cp-yu", 2055, 12},
- {"csIBM870", 2055, 8},
- {"IBM871", 2056, 6},
- {"CP871", 2056, 5},
- {"ebcdic-cp-is", 2056, 12},
- {"csIBM871", 2056, 8},
- {"IBM880", 2057, 6},
- {"cp880", 2057, 5},
- {"EBCDIC-Cyrillic", 2057, 15},
- {"csIBM880", 2057, 8},
- {"IBM891", 2058, 6},
- {"cp891", 2058, 5},
- {"csIBM891", 2058, 8},
- {"IBM903", 2059, 6},
- {"cp903", 2059, 5},
- {"csIBM903", 2059, 8},
- {"IBM904", 2060, 6},
- {"cp904", 2060, 5},
- {"904", 2060, 3},
- {"csIBBM904", 2060, 9},
- {"IBM905", 2061, 6},
- {"CP905", 2061, 5},
- {"ebcdic-cp-tr", 2061, 12},
- {"csIBM905", 2061, 8},
- {"IBM918", 2062, 6},
- {"CP918", 2062, 5},
- {"ebcdic-cp-ar2", 2062, 13},
- {"csIBM918", 2062, 8},
- {"IBM1026", 2063, 7},
- {"CP1026", 2063, 6},
- {"csIBM1026", 2063, 9},
- {"EBCDIC-AT-DE", 2064, 12},
- {"csIBMEBCDICATDE", 2064, 15},
- {"EBCDIC-AT-DE-A", 2065, 14},
- {"csEBCDICATDEA", 2065, 13},
- {"EBCDIC-CA-FR", 2066, 12},
- {"csEBCDICCAFR", 2066, 12},
- {"EBCDIC-DK-NO", 2067, 12},
- {"csEBCDICDKNO", 2067, 12},
- {"EBCDIC-DK-NO-A", 2068, 14},
- {"csEBCDICDKNOA", 2068, 13},
- {"EBCDIC-FI-SE", 2069, 12},
- {"csEBCDICFISE", 2069, 12},
- {"EBCDIC-FI-SE-A", 2070, 14},
- {"csEBCDICFISEA", 2070, 13},
- {"EBCDIC-FR", 2071, 9},
- {"csEBCDICFR", 2071, 10},
- {"EBCDIC-IT", 2072, 9},
- {"csEBCDICIT", 2072, 10},
- {"EBCDIC-PT", 2073, 9},
- {"csEBCDICPT", 2073, 10},
- {"EBCDIC-ES", 2074, 9},
- {"csEBCDICES", 2074, 10},
- {"EBCDIC-ES-A", 2075, 11},
- {"csEBCDICESA", 2075, 11},
- {"EBCDIC-ES-S", 2076, 11},
- {"csEBCDICESS", 2076, 11},
- {"EBCDIC-UK", 2077, 9},
- {"csEBCDICUK", 2077, 10},
- {"EBCDIC-US", 2078, 9},
- {"csEBCDICUS", 2078, 10},
- {"UNKNOWN-8BIT", 2079, 12},
- {"csUnknown8BiT", 2079, 13},
- {"MNEMONIC", 2080, 8},
- {"csMnemonic", 2080, 10},
- {"MNEM", 2081, 4},
- {"csMnem", 2081, 6},
- {"VISCII", 2082, 6},
- {"csVISCII", 2082, 8},
- {"VIQR", 2083, 4},
- {"csVIQR", 2083, 6},
- {"KOI8-R", 2084, 6},
- {"csKOI8R", 2084, 7},
- {"HZ-GB-2312", 2085, 10},
- {"IBM866", 2086, 6},
- {"cp866", 2086, 5},
- {"866", 2086, 3},
- {"csIBM866", 2086, 8},
- {"IBM775", 2087, 6},
- {"cp775", 2087, 5},
- {"csPC775Baltic", 2087, 13},
- {"KOI8-U", 2088, 6},
- {"csKOI8U", 2088, 7},
- {"IBM00858", 2089, 8},
- {"CCSID00858", 2089, 10},
- {"CP00858", 2089, 7},
- {"PC-Multilingual-850+euro", 2089, 24},
- {"csIBM00858", 2089, 10},
- {"IBM00924", 2090, 8},
- {"CCSID00924", 2090, 10},
- {"CP00924", 2090, 7},
- {"ebcdic-Latin9--euro", 2090, 19},
- {"csIBM00924", 2090, 10},
- {"IBM01140", 2091, 8},
- {"CCSID01140", 2091, 10},
- {"CP01140", 2091, 7},
- {"ebcdic-us-37+euro", 2091, 17},
- {"csIBM01140", 2091, 10},
- {"IBM01141", 2092, 8},
- {"CCSID01141", 2092, 10},
- {"CP01141", 2092, 7},
- {"ebcdic-de-273+euro", 2092, 18},
- {"csIBM01141", 2092, 10},
- {"IBM01142", 2093, 8},
- {"CCSID01142", 2093, 10},
- {"CP01142", 2093, 7},
- {"ebcdic-dk-277+euro", 2093, 18},
- {"ebcdic-no-277+euro", 2093, 18},
- {"csIBM01142", 2093, 10},
- {"IBM01143", 2094, 8},
- {"CCSID01143", 2094, 10},
- {"CP01143", 2094, 7},
- {"ebcdic-fi-278+euro", 2094, 18},
- {"ebcdic-se-278+euro", 2094, 18},
- {"csIBM01143", 2094, 10},
- {"IBM01144", 2095, 8},
- {"CCSID01144", 2095, 10},
- {"CP01144", 2095, 7},
- {"ebcdic-it-280+euro", 2095, 18},
- {"csIBM01144", 2095, 10},
- {"IBM01145", 2096, 8},
- {"CCSID01145", 2096, 10},
- {"CP01145", 2096, 7},
- {"ebcdic-es-284+euro", 2096, 18},
- {"csIBM01145", 2096, 10},
- {"IBM01146", 2097, 8},
- {"CCSID01146", 2097, 10},
- {"CP01146", 2097, 7},
- {"ebcdic-gb-285+euro", 2097, 18},
- {"csIBM01146", 2097, 10},
- {"IBM01147", 2098, 8},
- {"CCSID01147", 2098, 10},
- {"CP01147", 2098, 7},
- {"ebcdic-fr-297+euro", 2098, 18},
- {"csIBM01147", 2098, 10},
- {"IBM01148", 2099, 8},
- {"CCSID01148", 2099, 10},
- {"CP01148", 2099, 7},
- {"ebcdic-international-500+euro", 2099, 29},
- {"csIBM01148", 2099, 10},
- {"IBM01149", 2100, 8},
- {"CCSID01149", 2100, 10},
- {"CP01149", 2100, 7},
- {"ebcdic-is-871+euro", 2100, 18},
- {"csIBM01149", 2100, 10},
- {"Big5-HKSCS", 2101, 10},
- {"csBig5HKSCS", 2101, 11},
- {"IBM1047", 2102, 7},
- {"IBM-1047", 2102, 8},
- {"csIBM1047", 2102, 9},
- {"PTCP154", 2103, 7},
- {"csPTCP154", 2103, 9},
- {"PT154", 2103, 5},
- {"CP154", 2103, 5},
- {"Cyrillic-Asian", 2103, 14},
- {"Amiga-1251", 2104, 10},
- {"Ami1251", 2104, 7},
- {"Amiga1251", 2104, 9},
- {"Ami-1251", 2104, 8},
- {"csAmiga1251", 2104, 11},
- {"KOI7-switched", 2105, 13},
- {"csKOI7switched", 2105, 14},
- {"BRF", 2106, 3},
- {"csBRF", 2106, 5},
- {"TSCII", 2107, 5},
- {"csTSCII", 2107, 7},
- {"CP51932", 2108, 7},
- {"csCP51932", 2108, 9},
- {"windows-874", 2109, 11},
- {"cswindows874", 2109, 12},
- {"windows-1250", 2250, 12},
- {"cswindows1250", 2250, 13},
- {"windows-1251", 2251, 12},
- {"cswindows1251", 2251, 13},
- {"windows-1252", 2252, 12},
- {"cswindows1252", 2252, 13},
- {"windows-1253", 2253, 12},
- {"cswindows1253", 2253, 13},
- {"windows-1254", 2254, 12},
- {"cswindows1254", 2254, 13},
- {"windows-1255", 2255, 12},
- {"cswindows1255", 2255, 13},
- {"windows-1256", 2256, 12},
- {"cswindows1256", 2256, 13},
- {"windows-1257", 2257, 12},
- {"cswindows1257", 2257, 13},
- {"windows-1258", 2258, 12},
- {"cswindows1258", 2258, 13},
- {"TIS-620", 2259, 7},
- {"csTIS620", 2259, 8},
- {"ISO-8859-11", 2259, 11},
- {"CP50220", 2260, 7},
- {"csCP50220", 2260, 9},
- };
-
- const __encoding_data* __encoding_rep_ = __text_encoding_data + 1;
- char __name_[max_name_length + 1] = {0};
+ const __text_encoding_rep::__encoding_data* __encoding_rep_ = __text_encoding_rep::__text_encoding_data + 1;
+ char __name_[max_name_length + 1] = {0};
};
template <>
struct hash<text_encoding> {
- size_t operator()(const text_encoding& __enc) const noexcept { return std::hash<text_encoding::id>()(__enc.mib()); }
+ size_t operator()(const text_encoding& __enc) const noexcept {
+ return std::hash<std::text_encoding::id>()(__enc.mib());
+ }
};
template <>
inline constexpr bool ranges::enable_borrowed_range<text_encoding::aliases_view> = true;
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER >= 26
diff --git a/libcxx/include/__text_encoding/text_encoding_rep.h b/libcxx/include/__text_encoding/text_encoding_rep.h
new file mode 100644
index 0000000000000..e6cd45c1db435
--- /dev/null
+++ b/libcxx/include/__text_encoding/text_encoding_rep.h
@@ -0,0 +1,1307 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_REP_H
+#define _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_REP_H
+
+#include <__algorithm/copy_n.h>
+#include <__algorithm/find.h>
+#include <__algorithm/lower_bound.h>
+#include <__algorithm/min.h>
+#include <__assert>
+#include <__config>
+#include <__string/char_traits.h>
+#include <cstdint>
+#include <string_view>
+
+#if _LIBCPP_HAS_LOCALIZATION
+# include <__locale_dir/locale_base_api.h>
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+
+#include <__undef_macros>
+
+#if _LIBCPP_STD_VER >= 23
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+struct __text_encoding_rep;
+struct text_encoding;
+
+struct __text_encoding_rep {
+ static constexpr size_t __max_name_length_ = 63;
+
+private:
+ using __id_rep _LIBCPP_NODEBUG = int_least32_t;
+ struct __encoding_data {
+ const char* __name_;
+ __id_rep __mib_rep_;
+ uint_least32_t __name_size_;
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool
+ operator==(const __encoding_data& __e, const __encoding_data& __other) noexcept {
+ return __e.__mib_rep_ == __other.__mib_rep_ ||
+ __comp_name(string_view(__e.__name_, __e.__name_size_), string_view(__other.__name_, __e.__name_size_));
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator<(const __encoding_data& __e, const __id_rep __i) noexcept {
+ return __e.__mib_rep_ < __i;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI friend constexpr bool
+ operator==(const __encoding_data& __e, std::string_view __name) noexcept {
+ return __comp_name(__name, string_view(__e.__name_, __e.__name_size_));
+ }
+ };
+
+public:
+ enum class __id : __id_rep {
+ other = 1,
+ unknown = 2,
+ ASCII = 3,
+ ISOLatin1 = 4,
+ ISOLatin2 = 5,
+ ISOLatin3 = 6,
+ ISOLatin4 = 7,
+ ISOLatinCyrillic = 8,
+ ISOLatinArabic = 9,
+ ISOLatinGreek = 10,
+ ISOLatinHebrew = 11,
+ ISOLatin5 = 12,
+ ISOLatin6 = 13,
+ ISOTextComm = 14,
+ HalfWidthKatakana = 15,
+ JISEncoding = 16,
+ ShiftJIS = 17,
+ EUCPkdFmtJapanese = 18,
+ EUCFixWidJapanese = 19,
+ ISO4UnitedKingdom = 20,
+ ISO11SwedishForNames = 21,
+ ISO15Italian = 22,
+ ISO17Spanish = 23,
+ ISO21German = 24,
+ ISO60DanishNorwegian = 25,
+ ISO69French = 26,
+ ISO10646UTF1 = 27,
+ ISO646basic1983 = 28,
+ INVARIANT = 29,
+ ISO2IntlRefVersion = 30,
+ NATSSEFI = 31,
+ NATSSEFIADD = 32,
+ ISO10Swedish = 35,
+ KSC56011987 = 36,
+ ISO2022KR = 37,
+ EUCKR = 38,
+ ISO2022JP = 39,
+ ISO2022JP2 = 40,
+ ISO13JISC6220jp = 41,
+ ISO14JISC6220ro = 42,
+ ISO16Portuguese = 43,
+ ISO18Greek7Old = 44,
+ ISO19LatinGreek = 45,
+ ISO25French = 46,
+ ISO27LatinGreek1 = 47,
+ ISO5427Cyrillic = 48,
+ ISO42JISC62261978 = 49,
+ ISO47BSViewdata = 50,
+ ISO49INIS = 51,
+ ISO50INIS8 = 52,
+ ISO51INISCyrillic = 53,
+ ISO54271981 = 54,
+ ISO5428Greek = 55,
+ ISO57GB1988 = 56,
+ ISO58GB231280 = 57,
+ ISO61Norwegian2 = 58,
+ ISO70VideotexSupp1 = 59,
+ ISO84Portuguese2 = 60,
+ ISO85Spanish2 = 61,
+ ISO86Hungarian = 62,
+ ISO87JISX0208 = 63,
+ ISO88Greek7 = 64,
+ ISO89ASMO449 = 65,
+ ISO90 = 66,
+ ISO91JISC62291984a = 67,
+ ISO92JISC62991984b = 68,
+ ISO93JIS62291984badd = 69,
+ ISO94JIS62291984hand = 70,
+ ISO95JIS62291984handadd = 71,
+ ISO96JISC62291984kana = 72,
+ ISO2033 = 73,
+ ISO99NAPLPS = 74,
+ ISO102T617bit = 75,
+ ISO103T618bit = 76,
+ ISO111ECMACyrillic = 77,
+ ISO121Canadian1 = 78,
+ ISO122Canadian2 = 79,
+ ISO123CSAZ24341985gr = 80,
+ ISO88596E = 81,
+ ISO88596I = 82,
+ ISO128T101G2 = 83,
+ ISO88598E = 84,
+ ISO88598I = 85,
+ ISO139CSN369103 = 86,
+ ISO141JUSIB1002 = 87,
+ ISO143IECP271 = 88,
+ ISO146Serbian = 89,
+ ISO147Macedonian = 90,
+ ISO150 = 91,
+ ISO151Cuba = 92,
+ ISO6937Add = 93,
+ ISO153GOST1976874 = 94,
+ ISO8859Supp = 95,
+ ISO10367Box = 96,
+ ISO158Lap = 97,
+ ISO159JISX02121990 = 98,
+ ISO646Danish = 99,
+ USDK = 100,
+ DKUS = 101,
+ KSC5636 = 102,
+ Unicode11UTF7 = 103,
+ ISO2022CN = 104,
+ ISO2022CNEXT = 105,
+ UTF8 = 106,
+ ISO885913 = 109,
+ ISO885914 = 110,
+ ISO885915 = 111,
+ ISO885916 = 112,
+ GBK = 113,
+ GB18030 = 114,
+ OSDEBCDICDF0415 = 115,
+ OSDEBCDICDF03IRV = 116,
+ OSDEBCDICDF041 = 117,
+ ISO115481 = 118,
+ KZ1048 = 119,
+ UCS2 = 1000,
+ UCS4 = 1001,
+ UnicodeASCII = 1002,
+ UnicodeLatin1 = 1003,
+ UnicodeJapanese = 1004,
+ UnicodeIBM1261 = 1005,
+ UnicodeIBM1268 = 1006,
+ UnicodeIBM1276 = 1007,
+ UnicodeIBM1264 = 1008,
+ UnicodeIBM1265 = 1009,
+ Unicode11 = 1010,
+ SCSU = 1011,
+ UTF7 = 1012,
+ UTF16BE = 1013,
+ UTF16LE = 1014,
+ UTF16 = 1015,
+ CESU8 = 1016,
+ UTF32 = 1017,
+ UTF32BE = 1018,
+ UTF32LE = 1019,
+ BOCU1 = 1020,
+ UTF7IMAP = 1021,
+ Windows30Latin1 = 2000,
+ Windows31Latin1 = 2001,
+ Windows31Latin2 = 2002,
+ Windows31Latin5 = 2003,
+ HPRoman8 = 2004,
+ AdobeStandardEncoding = 2005,
+ VenturaUS = 2006,
+ VenturaInternational = 2007,
+ DECMCS = 2008,
+ PC850Multilingual = 2009,
+ PC8DanishNorwegian = 2012,
+ PC862LatinHebrew = 2013,
+ PC8Turkish = 2014,
+ IBMSymbols = 2015,
+ IBMThai = 2016,
+ HPLegal = 2017,
+ HPPiFont = 2018,
+ HPMath8 = 2019,
+ HPPSMath = 2020,
+ HPDesktop = 2021,
+ VenturaMath = 2022,
+ MicrosoftPublishing = 2023,
+ Windows31J = 2024,
+ GB2312 = 2025,
+ Big5 = 2026,
+ Macintosh = 2027,
+ IBM037 = 2028,
+ IBM038 = 2029,
+ IBM273 = 2030,
+ IBM274 = 2031,
+ IBM275 = 2032,
+ IBM277 = 2033,
+ IBM278 = 2034,
+ IBM280 = 2035,
+ IBM281 = 2036,
+ IBM284 = 2037,
+ IBM285 = 2038,
+ IBM290 = 2039,
+ IBM297 = 2040,
+ IBM420 = 2041,
+ IBM423 = 2042,
+ IBM424 = 2043,
+ PC8CodePage437 = 2011,
+ IBM500 = 2044,
+ IBM851 = 2045,
+ PCp852 = 2010,
+ IBM855 = 2046,
+ IBM857 = 2047,
+ IBM860 = 2048,
+ IBM861 = 2049,
+ IBM863 = 2050,
+ IBM864 = 2051,
+ IBM865 = 2052,
+ IBM868 = 2053,
+ IBM869 = 2054,
+ IBM870 = 2055,
+ IBM871 = 2056,
+ IBM880 = 2057,
+ IBM891 = 2058,
+ IBM903 = 2059,
+ IBM904 = 2060,
+ IBM905 = 2061,
+ IBM918 = 2062,
+ IBM1026 = 2063,
+ IBMEBCDICATDE = 2064,
+ EBCDICATDEA = 2065,
+ EBCDICCAFR = 2066,
+ EBCDICDKNO = 2067,
+ EBCDICDKNOA = 2068,
+ EBCDICFISE = 2069,
+ EBCDICFISEA = 2070,
+ EBCDICFR = 2071,
+ EBCDICIT = 2072,
+ EBCDICPT = 2073,
+ EBCDICES = 2074,
+ EBCDICESA = 2075,
+ EBCDICESS = 2076,
+ EBCDICUK = 2077,
+ EBCDICUS = 2078,
+ Unknown8BiT = 2079,
+ Mnemonic = 2080,
+ Mnem = 2081,
+ VISCII = 2082,
+ VIQR = 2083,
+ KOI8R = 2084,
+ HZGB2312 = 2085,
+ IBM866 = 2086,
+ PC775Baltic = 2087,
+ KOI8U = 2088,
+ IBM00858 = 2089,
+ IBM00924 = 2090,
+ IBM01140 = 2091,
+ IBM01141 = 2092,
+ IBM01142 = 2093,
+ IBM01143 = 2094,
+ IBM01144 = 2095,
+ IBM01145 = 2096,
+ IBM01146 = 2097,
+ IBM01147 = 2098,
+ IBM01148 = 2099,
+ IBM01149 = 2100,
+ Big5HKSCS = 2101,
+ IBM1047 = 2102,
+ PTCP154 = 2103,
+ Amiga1251 = 2104,
+ KOI7switched = 2105,
+ BRF = 2106,
+ TSCII = 2107,
+ CP51932 = 2108,
+ windows874 = 2109,
+ windows1250 = 2250,
+ windows1251 = 2251,
+ windows1252 = 2252,
+ windows1253 = 2253,
+ windows1254 = 2254,
+ windows1255 = 2255,
+ windows1256 = 2256,
+ windows1257 = 2257,
+ windows1258 = 2258,
+ TIS620 = 2259,
+ CP50220 = 2260
+ };
+
+# if _LIBCPP_HAS_LOCALIZATION
+ static _LIBCPP_EXPORTED_FROM_ABI __text_encoding_rep __get_locale_encoding(const char* __name);
+# else
+ static _LIBCPP_EXPORTED_FROM_ABI __text_encoding_rep __get_locale_encoding(const char* __name) = delete;
+# endif // _LIBCPP_HAS_LOCALIZATION
+
+private:
+ _LIBCPP_HIDE_FROM_ABI constexpr __text_encoding_rep() = default;
+
+ _LIBCPP_HIDE_FROM_ABI constexpr explicit __text_encoding_rep(string_view __enc) noexcept
+ : __encoding_rep_(__find_encoding_data(__enc)) {
+ __enc.copy(__name_, __max_name_length_, 0);
+ }
+
+ _LIBCPP_HIDE_FROM_ABI static constexpr bool __comp_name(string_view __a, string_view __b) {
+ if (__a.empty() || __b.empty()) {
+ return false;
+ }
+
+ // map any non-alphanumeric character to 255, skip prefix 0s, else get tolower(__n)
+ auto __map_char = [](char __n, bool& __in_number) -> unsigned char {
+ auto __to_lower = [](char __n_in) -> char {
+ return (__n_in >= 'A' && __n_in <= 'Z') ? __n_in + ('a' - 'A') : __n_in;
+ };
+ if (__n == '0') {
+ return __in_number ? '0' : 255;
+ }
+ __in_number = __n >= '1' && __n <= '9';
+ return (__n >= '1' && __n <= '9') || (__n >= 'A' && __n <= 'Z') || (__n >= 'a' && __n <= 'z')
+ ? __to_lower(__n)
+ : 255;
+ };
+
+ auto __a_ptr = __a.begin(), __b_ptr = __b.begin();
+ bool __a_in_number = false, __b_in_number = false;
+
+ unsigned char __a_val = 255, __b_val = 255;
+ for (;; __a_ptr++, __b_ptr++) {
+ while (__a_ptr != __a.end() && (__a_val = __map_char(*__a_ptr, __a_in_number)) == 255)
+ __a_ptr++;
+ while (__b_ptr != __b.end() && (__b_val = __map_char(*__b_ptr, __b_in_number)) == 255)
+ __b_ptr++;
+
+ if (__a_ptr == __a.end())
+ return __b_ptr == __b.end();
+ if (__b_ptr == __b.end())
+ return false;
+ if (__a_val != __b_val)
+ return false;
+ }
+ return true;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI static constexpr const __encoding_data* __find_encoding_data(string_view __a) {
+ _LIBCPP_ASSERT(__a.size() <= __max_name_length_, "Passing encoding name longer than max_name_length!");
+ auto __data_ptr = __text_encoding_data + 2, __data_last = std::end(__text_encoding_data);
+ auto __found_data = std::find(__data_ptr, __data_last, __a);
+
+ if (__found_data == __data_last) {
+ return __text_encoding_data; // other
+ }
+
+ while (__found_data[-1].__mib_rep_ == __found_data->__mib_rep_) {
+ __found_data--;
+ }
+
+ return __found_data;
+ }
+
+ _LIBCPP_HIDE_FROM_ABI static constexpr const __encoding_data* __find_encoding_data_by_id(__id __i) {
+ _LIBCPP_ASSERT(__i >= __id::other && __i <= __id::CP50220 && __id_rep(__i) != 33 && __id_rep(__i) != 34,
+ "Passing invalid id to text_encoding constructor!");
+ auto __found = std::lower_bound(std::begin(__text_encoding_data), std::end(__text_encoding_data), __id_rep(__i));
+ return __found != std::end(__text_encoding_data)
+ ? __found
+ : __text_encoding_data + 1; // unknown, should be unreachable
+ }
+
+ _LIBCPP_HIDE_FROM_ABI static constexpr __encoding_data __text_encoding_data[] = {
+ {"", 1, 0},
+ {"", 2, 0},
+ {"US-ASCII", 3, 8},
+ {"iso-ir-6", 3, 8},
+ {"ANSI_X3.4-1968", 3, 14},
+ {"ANSI_X3.4-1986", 3, 14},
+ {"ISO_646.irv:1991", 3, 16},
+ {"ISO646-US", 3, 9},
+ {"us", 3, 2},
+ {"IBM367", 3, 6},
+ {"cp367", 3, 5},
+ {"csASCII", 3, 7},
+ {"ASCII", 3, 5},
+ {"ISO_8859-1:1987", 4, 15},
+ {"iso-ir-100", 4, 10},
+ {"ISO_8859-1", 4, 10},
+ {"ISO-8859-1", 4, 10},
+ {"latin1", 4, 6},
+ {"l1", 4, 2},
+ {"IBM819", 4, 6},
+ {"CP819", 4, 5},
+ {"csISOLatin1", 4, 11},
+ {"ISO_8859-2:1987", 5, 15},
+ {"iso-ir-101", 5, 10},
+ {"ISO_8859-2", 5, 10},
+ {"ISO-8859-2", 5, 10},
+ {"latin2", 5, 6},
+ {"l2", 5, 2},
+ {"csISOLatin2", 5, 11},
+ {"ISO_8859-3:1988", 6, 15},
+ {"iso-ir-109", 6, 10},
+ {"ISO_8859-3", 6, 10},
+ {"ISO-8859-3", 6, 10},
+ {"latin3", 6, 6},
+ {"l3", 6, 2},
+ {"csISOLatin3", 6, 11},
+ {"ISO_8859-4:1988", 7, 15},
+ {"iso-ir-110", 7, 10},
+ {"ISO_8859-4", 7, 10},
+ {"ISO-8859-4", 7, 10},
+ {"latin4", 7, 6},
+ {"l4", 7, 2},
+ {"csISOLatin4", 7, 11},
+ {"ISO_8859-5:1988", 8, 15},
+ {"iso-ir-144", 8, 10},
+ {"ISO_8859-5", 8, 10},
+ {"ISO-8859-5", 8, 10},
+ {"cyrillic", 8, 8},
+ {"csISOLatinCyrillic", 8, 18},
+ {"ISO_8859-6:1987", 9, 15},
+ {"iso-ir-127", 9, 10},
+ {"ISO_8859-6", 9, 10},
+ {"ISO-8859-6", 9, 10},
+ {"ECMA-114", 9, 8},
+ {"ASMO-708", 9, 8},
+ {"arabic", 9, 6},
+ {"csISOLatinArabic", 9, 16},
+ {"ISO_8859-7:1987", 10, 15},
+ {"iso-ir-126", 10, 10},
+ {"ISO_8859-7", 10, 10},
+ {"ISO-8859-7", 10, 10},
+ {"ELOT_928", 10, 8},
+ {"ECMA-118", 10, 8},
+ {"greek", 10, 5},
+ {"greek8", 10, 6},
+ {"csISOLatinGreek", 10, 15},
+ {"ISO_8859-8:1988", 11, 15},
+ {"iso-ir-138", 11, 10},
+ {"ISO_8859-8", 11, 10},
+ {"ISO-8859-8", 11, 10},
+ {"hebrew", 11, 6},
+ {"csISOLatinHebrew", 11, 16},
+ {"ISO_8859-9:1989", 12, 15},
+ {"iso-ir-148", 12, 10},
+ {"ISO_8859-9", 12, 10},
+ {"ISO-8859-9", 12, 10},
+ {"latin5", 12, 6},
+ {"l5", 12, 2},
+ {"csISOLatin5", 12, 11},
+ {"ISO-8859-10", 13, 11},
+ {"iso-ir-157", 13, 10},
+ {"l6", 13, 2},
+ {"ISO_8859-10:1992", 13, 16},
+ {"csISOLatin6", 13, 11},
+ {"latin6", 13, 6},
+ {"ISO_6937-2-add", 14, 14},
+ {"iso-ir-142", 14, 10},
+ {"csISOTextComm", 14, 13},
+ {"JIS_X0201", 15, 9},
+ {"X0201", 15, 5},
+ {"csHalfWidthKatakana", 15, 19},
+ {"JIS_Encoding", 16, 12},
+ {"csJISEncoding", 16, 13},
+ {"Shift_JIS", 17, 9},
+ {"MS_Kanji", 17, 8},
+ {"csShiftJIS", 17, 10},
+ {"Extended_UNIX_Code_Packed_Format_for_Japanese", 18, 45},
+ {"csEUCPkdFmtJapanese", 18, 19},
+ {"EUC-JP", 18, 6},
+ {"Extended_UNIX_Code_Fixed_Width_for_Japanese", 19, 43},
+ {"csEUCFixWidJapanese", 19, 19},
+ {"BS_4730", 20, 7},
+ {"iso-ir-4", 20, 8},
+ {"ISO646-GB", 20, 9},
+ {"gb", 20, 2},
+ {"uk", 20, 2},
+ {"csISO4UnitedKingdom", 20, 19},
+ {"SEN_850200_C", 21, 12},
+ {"iso-ir-11", 21, 9},
+ {"ISO646-SE2", 21, 10},
+ {"se2", 21, 3},
+ {"csISO11SwedishForNames", 21, 22},
+ {"IT", 22, 2},
+ {"iso-ir-15", 22, 9},
+ {"ISO646-IT", 22, 9},
+ {"csISO15Italian", 22, 14},
+ {"ES", 23, 2},
+ {"iso-ir-17", 23, 9},
+ {"ISO646-ES", 23, 9},
+ {"csISO17Spanish", 23, 14},
+ {"DIN_66003", 24, 9},
+ {"iso-ir-21", 24, 9},
+ {"de", 24, 2},
+ {"ISO646-DE", 24, 9},
+ {"csISO21German", 24, 13},
+ {"NS_4551-1", 25, 9},
+ {"iso-ir-60", 25, 9},
+ {"ISO646-NO", 25, 9},
+ {"no", 25, 2},
+ {"csISO60DanishNorwegian", 25, 22},
+ {"csISO60Norwegian1", 25, 17},
+ {"NF_Z_62-010", 26, 11},
+ {"iso-ir-69", 26, 9},
+ {"ISO646-FR", 26, 9},
+ {"fr", 26, 2},
+ {"csISO69French", 26, 13},
+ {"ISO-10646-UTF-1", 27, 15},
+ {"csISO10646UTF1", 27, 14},
+ {"ISO_646.basic:1983", 28, 18},
+ {"ref", 28, 3},
+ {"csISO646basic1983", 28, 17},
+ {"INVARIANT", 29, 9},
+ {"csINVARIANT", 29, 11},
+ {"ISO_646.irv:1983", 30, 16},
+ {"iso-ir-2", 30, 8},
+ {"irv", 30, 3},
+ {"csISO2IntlRefVersion", 30, 20},
+ {"NATS-SEFI", 31, 9},
+ {"iso-ir-8-1", 31, 10},
+ {"csNATSSEFI", 31, 10},
+ {"NATS-SEFI-ADD", 32, 13},
+ {"iso-ir-8-2", 32, 10},
+ {"csNATSSEFIADD", 32, 13},
+ {"SEN_850200_B", 35, 12},
+ {"iso-ir-10", 35, 9},
+ {"FI", 35, 2},
+ {"ISO646-FI", 35, 9},
+ {"ISO646-SE", 35, 9},
+ {"se", 35, 2},
+ {"csISO10Swedish", 35, 14},
+ {"KS_C_5601-1987", 36, 14},
+ {"iso-ir-149", 36, 10},
+ {"KS_C_5601-1989", 36, 14},
+ {"KSC_5601", 36, 8},
+ {"korean", 36, 6},
+ {"csKSC56011987", 36, 13},
+ {"ISO-2022-KR", 37, 11},
+ {"csISO2022KR", 37, 11},
+ {"EUC-KR", 38, 6},
+ {"csEUCKR", 38, 7},
+ {"ISO-2022-JP", 39, 11},
+ {"csISO2022JP", 39, 11},
+ {"ISO-2022-JP-2", 40, 13},
+ {"csISO2022JP2", 40, 12},
+ {"JIS_C6220-1969-jp", 41, 17},
+ {"JIS_C6220-1969", 41, 14},
+ {"iso-ir-13", 41, 9},
+ {"katakana", 41, 8},
+ {"x0201-7", 41, 7},
+ {"csISO13JISC6220jp", 41, 17},
+ {"JIS_C6220-1969-ro", 42, 17},
+ {"iso-ir-14", 42, 9},
+ {"jp", 42, 2},
+ {"ISO646-JP", 42, 9},
+ {"csISO14JISC6220ro", 42, 17},
+ {"PT", 43, 2},
+ {"iso-ir-16", 43, 9},
+ {"ISO646-PT", 43, 9},
+ {"csISO16Portuguese", 43, 17},
+ {"greek7-old", 44, 10},
+ {"iso-ir-18", 44, 9},
+ {"csISO18Greek7Old", 44, 16},
+ {"latin-greek", 45, 11},
+ {"iso-ir-19", 45, 9},
+ {"csISO19LatinGreek", 45, 17},
+ {"NF_Z_62-010_(1973)", 46, 18},
+ {"iso-ir-25", 46, 9},
+ {"ISO646-FR1", 46, 10},
+ {"csISO25French", 46, 13},
+ {"Latin-greek-1", 47, 13},
+ {"iso-ir-27", 47, 9},
+ {"csISO27LatinGreek1", 47, 18},
+ {"ISO_5427", 48, 8},
+ {"iso-ir-37", 48, 9},
+ {"csISO5427Cyrillic", 48, 17},
+ {"JIS_C6226-1978", 49, 14},
+ {"iso-ir-42", 49, 9},
+ {"csISO42JISC62261978", 49, 19},
+ {"BS_viewdata", 50, 11},
+ {"iso-ir-47", 50, 9},
+ {"csISO47BSViewdata", 50, 17},
+ {"INIS", 51, 4},
+ {"iso-ir-49", 51, 9},
+ {"csISO49INIS", 51, 11},
+ {"INIS-8", 52, 6},
+ {"iso-ir-50", 52, 9},
+ {"csISO50INIS8", 52, 12},
+ {"INIS-cyrillic", 53, 13},
+ {"iso-ir-51", 53, 9},
+ {"csISO51INISCyrillic", 53, 19},
+ {"ISO_5427:1981", 54, 13},
+ {"iso-ir-54", 54, 9},
+ {"ISO5427Cyrillic1981", 54, 19},
+ {"csISO54271981", 54, 13},
+ {"ISO_5428:1980", 55, 13},
+ {"iso-ir-55", 55, 9},
+ {"csISO5428Greek", 55, 14},
+ {"GB_1988-80", 56, 10},
+ {"iso-ir-57", 56, 9},
+ {"cn", 56, 2},
+ {"ISO646-CN", 56, 9},
+ {"csISO57GB1988", 56, 13},
+ {"GB_2312-80", 57, 10},
+ {"iso-ir-58", 57, 9},
+ {"chinese", 57, 7},
+ {"csISO58GB231280", 57, 15},
+ {"NS_4551-2", 58, 9},
+ {"ISO646-NO2", 58, 10},
+ {"iso-ir-61", 58, 9},
+ {"no2", 58, 3},
+ {"csISO61Norwegian2", 58, 17},
+ {"videotex-suppl", 59, 14},
+ {"iso-ir-70", 59, 9},
+ {"csISO70VideotexSupp1", 59, 20},
+ {"PT2", 60, 3},
+ {"iso-ir-84", 60, 9},
+ {"ISO646-PT2", 60, 10},
+ {"csISO84Portuguese2", 60, 18},
+ {"ES2", 61, 3},
+ {"iso-ir-85", 61, 9},
+ {"ISO646-ES2", 61, 10},
+ {"csISO85Spanish2", 61, 15},
+ {"MSZ_7795.3", 62, 10},
+ {"iso-ir-86", 62, 9},
+ {"ISO646-HU", 62, 9},
+ {"hu", 62, 2},
+ {"csISO86Hungarian", 62, 16},
+ {"JIS_C6226-1983", 63, 14},
+ {"iso-ir-87", 63, 9},
+ {"x0208", 63, 5},
+ {"JIS_X0208-1983", 63, 14},
+ {"csISO87JISX0208", 63, 15},
+ {"greek7", 64, 6},
+ {"iso-ir-88", 64, 9},
+ {"csISO88Greek7", 64, 13},
+ {"ASMO_449", 65, 8},
+ {"ISO_9036", 65, 8},
+ {"arabic7", 65, 7},
+ {"iso-ir-89", 65, 9},
+ {"csISO89ASMO449", 65, 14},
+ {"iso-ir-90", 66, 9},
+ {"csISO90", 66, 7},
+ {"JIS_C6229-1984-a", 67, 16},
+ {"iso-ir-91", 67, 9},
+ {"jp-ocr-a", 67, 8},
+ {"csISO91JISC62291984a", 67, 20},
+ {"JIS_C6229-1984-b", 68, 16},
+ {"iso-ir-92", 68, 9},
+ {"ISO646-JP-OCR-B", 68, 15},
+ {"jp-ocr-b", 68, 8},
+ {"csISO92JISC62991984b", 68, 20},
+ {"JIS_C6229-1984-b-add", 69, 20},
+ {"iso-ir-93", 69, 9},
+ {"jp-ocr-b-add", 69, 12},
+ {"csISO93JIS62291984badd", 69, 22},
+ {"JIS_C6229-1984-hand", 70, 19},
+ {"iso-ir-94", 70, 9},
+ {"jp-ocr-hand", 70, 11},
+ {"csISO94JIS62291984hand", 70, 22},
+ {"JIS_C6229-1984-hand-add", 71, 23},
+ {"iso-ir-95", 71, 9},
+ {"jp-ocr-hand-add", 71, 15},
+ {"csISO95JIS62291984handadd", 71, 25},
+ {"JIS_C6229-1984-kana", 72, 19},
+ {"iso-ir-96", 72, 9},
+ {"csISO96JISC62291984kana", 72, 23},
+ {"ISO_2033-1983", 73, 13},
+ {"iso-ir-98", 73, 9},
+ {"e13b", 73, 4},
+ {"csISO2033", 73, 9},
+ {"ANSI_X3.110-1983", 74, 16},
+ {"iso-ir-99", 74, 9},
+ {"CSA_T500-1983", 74, 13},
+ {"NAPLPS", 74, 6},
+ {"csISO99NAPLPS", 74, 13},
+ {"T.61-7bit", 75, 9},
+ {"iso-ir-102", 75, 10},
+ {"csISO102T617bit", 75, 15},
+ {"T.61-8bit", 76, 9},
+ {"T.61", 76, 4},
+ {"iso-ir-103", 76, 10},
+ {"csISO103T618bit", 76, 15},
+ {"ECMA-cyrillic", 77, 13},
+ {"iso-ir-111", 77, 10},
+ {"KOI8-E", 77, 6},
+ {"csISO111ECMACyrillic", 77, 20},
+ {"CSA_Z243.4-1985-1", 78, 17},
+ {"iso-ir-121", 78, 10},
+ {"ISO646-CA", 78, 9},
+ {"csa7-1", 78, 6},
+ {"csa71", 78, 5},
+ {"ca", 78, 2},
+ {"csISO121Canadian1", 78, 17},
+ {"CSA_Z243.4-1985-2", 79, 17},
+ {"iso-ir-122", 79, 10},
+ {"ISO646-CA2", 79, 10},
+ {"csa7-2", 79, 6},
+ {"csa72", 79, 5},
+ {"csISO122Canadian2", 79, 17},
+ {"CSA_Z243.4-1985-gr", 80, 18},
+ {"iso-ir-123", 80, 10},
+ {"csISO123CSAZ24341985gr", 80, 22},
+ {"ISO_8859-6-E", 81, 12},
+ {"csISO88596E", 81, 11},
+ {"ISO-8859-6-E", 81, 12},
+ {"ISO_8859-6-I", 82, 12},
+ {"csISO88596I", 82, 11},
+ {"ISO-8859-6-I", 82, 12},
+ {"T.101-G2", 83, 8},
+ {"iso-ir-128", 83, 10},
+ {"csISO128T101G2", 83, 14},
+ {"ISO_8859-8-E", 84, 12},
+ {"csISO88598E", 84, 11},
+ {"ISO-8859-8-E", 84, 12},
+ {"ISO_8859-8-I", 85, 12},
+ {"csISO88598I", 85, 11},
+ {"ISO-8859-8-I", 85, 12},
+ {"CSN_369103", 86, 10},
+ {"iso-ir-139", 86, 10},
+ {"csISO139CSN369103", 86, 17},
+ {"JUS_I.B1.002", 87, 12},
+ {"iso-ir-141", 87, 10},
+ {"ISO646-YU", 87, 9},
+ {"js", 87, 2},
+ {"yu", 87, 2},
+ {"csISO141JUSIB1002", 87, 17},
+ {"IEC_P27-1", 88, 9},
+ {"iso-ir-143", 88, 10},
+ {"csISO143IECP271", 88, 15},
+ {"JUS_I.B1.003-serb", 89, 17},
+ {"iso-ir-146", 89, 10},
+ {"serbian", 89, 7},
+ {"csISO146Serbian", 89, 15},
+ {"JUS_I.B1.003-mac", 90, 16},
+ {"macedonian", 90, 10},
+ {"iso-ir-147", 90, 10},
+ {"csISO147Macedonian", 90, 18},
+ {"greek-ccitt", 91, 11},
+ {"iso-ir-150", 91, 10},
+ {"csISO150", 91, 8},
+ {"csISO150GreekCCITT", 91, 18},
+ {"NC_NC00-10:81", 92, 13},
+ {"cuba", 92, 4},
+ {"iso-ir-151", 92, 10},
+ {"ISO646-CU", 92, 9},
+ {"csISO151Cuba", 92, 12},
+ {"ISO_6937-2-25", 93, 13},
+ {"iso-ir-152", 93, 10},
+ {"csISO6937Add", 93, 12},
+ {"GOST_19768-74", 94, 13},
+ {"ST_SEV_358-88", 94, 13},
+ {"iso-ir-153", 94, 10},
+ {"csISO153GOST1976874", 94, 19},
+ {"ISO_8859-supp", 95, 13},
+ {"iso-ir-154", 95, 10},
+ {"latin1-2-5", 95, 10},
+ {"csISO8859Supp", 95, 13},
+ {"ISO_10367-box", 96, 13},
+ {"iso-ir-155", 96, 10},
+ {"csISO10367Box", 96, 13},
+ {"latin-lap", 97, 9},
+ {"lap", 97, 3},
+ {"iso-ir-158", 97, 10},
+ {"csISO158Lap", 97, 11},
+ {"JIS_X0212-1990", 98, 14},
+ {"x0212", 98, 5},
+ {"iso-ir-159", 98, 10},
+ {"csISO159JISX02121990", 98, 20},
+ {"DS_2089", 99, 7},
+ {"DS2089", 99, 6},
+ {"ISO646-DK", 99, 9},
+ {"dk", 99, 2},
+ {"csISO646Danish", 99, 14},
+ {"us-dk", 100, 5},
+ {"csUSDK", 100, 6},
+ {"dk-us", 101, 5},
+ {"csDKUS", 101, 6},
+ {"KSC5636", 102, 7},
+ {"ISO646-KR", 102, 9},
+ {"csKSC5636", 102, 9},
+ {"UNICODE-1-1-UTF-7", 103, 17},
+ {"csUnicode11UTF7", 103, 15},
+ {"ISO-2022-CN", 104, 11},
+ {"csISO2022CN", 104, 11},
+ {"ISO-2022-CN-EXT", 105, 15},
+ {"csISO2022CNEXT", 105, 14},
+ {"UTF-8", 106, 5},
+ {"csUTF8", 106, 6},
+ {"ISO-8859-13", 109, 11},
+ {"csISO885913", 109, 11},
+ {"ISO-8859-14", 110, 11},
+ {"iso-ir-199", 110, 10},
+ {"ISO_8859-14:1998", 110, 16},
+ {"ISO_8859-14", 110, 11},
+ {"latin8", 110, 6},
+ {"iso-celtic", 110, 10},
+ {"l8", 110, 2},
+ {"csISO885914", 110, 11},
+ {"ISO-8859-15", 111, 11},
+ {"ISO_8859-15", 111, 11},
+ {"Latin-9", 111, 7},
+ {"csISO885915", 111, 11},
+ {"ISO-8859-16", 112, 11},
+ {"iso-ir-226", 112, 10},
+ {"ISO_8859-16:2001", 112, 16},
+ {"ISO_8859-16", 112, 11},
+ {"latin10", 112, 7},
+ {"l10", 112, 3},
+ {"csISO885916", 112, 11},
+ {"GBK", 113, 3},
+ {"CP936", 113, 5},
+ {"MS936", 113, 5},
+ {"windows-936", 113, 11},
+ {"csGBK", 113, 5},
+ {"GB18030", 114, 7},
+ {"csGB18030", 114, 9},
+ {"OSD_EBCDIC_DF04_15", 115, 18},
+ {"csOSDEBCDICDF0415", 115, 17},
+ {"OSD_EBCDIC_DF03_IRV", 116, 19},
+ {"csOSDEBCDICDF03IRV", 116, 18},
+ {"OSD_EBCDIC_DF04_1", 117, 17},
+ {"csOSDEBCDICDF041", 117, 16},
+ {"ISO-11548-1", 118, 11},
+ {"ISO_11548-1", 118, 11},
+ {"ISO_TR_11548-1", 118, 14},
+ {"csISO115481", 118, 11},
+ {"KZ-1048", 119, 7},
+ {"STRK1048-2002", 119, 13},
+ {"RK1048", 119, 6},
+ {"csKZ1048", 119, 8},
+ {"ISO-10646-UCS-2", 1000, 15},
+ {"csUnicode", 1000, 9},
+ {"ISO-10646-UCS-4", 1001, 15},
+ {"csUCS4", 1001, 6},
+ {"ISO-10646-UCS-Basic", 1002, 19},
+ {"csUnicodeASCII", 1002, 14},
+ {"ISO-10646-Unicode-Latin1", 1003, 24},
+ {"csUnicodeLatin1", 1003, 15},
+ {"ISO-10646", 1003, 9},
+ {"ISO-10646-J-1", 1004, 13},
+ {"csUnicodeJapanese", 1004, 17},
+ {"ISO-Unicode-IBM-1261", 1005, 20},
+ {"csUnicodeIBM1261", 1005, 16},
+ {"ISO-Unicode-IBM-1268", 1006, 20},
+ {"csUnicodeIBM1268", 1006, 16},
+ {"ISO-Unicode-IBM-1276", 1007, 20},
+ {"csUnicodeIBM1276", 1007, 16},
+ {"ISO-Unicode-IBM-1264", 1008, 20},
+ {"csUnicodeIBM1264", 1008, 16},
+ {"ISO-Unicode-IBM-1265", 1009, 20},
+ {"csUnicodeIBM1265", 1009, 16},
+ {"UNICODE-1-1", 1010, 11},
+ {"csUnicode11", 1010, 11},
+ {"SCSU", 1011, 4},
+ {"csSCSU", 1011, 6},
+ {"UTF-7", 1012, 5},
+ {"csUTF7", 1012, 6},
+ {"UTF-16BE", 1013, 8},
+ {"csUTF16BE", 1013, 9},
+ {"UTF-16LE", 1014, 8},
+ {"csUTF16LE", 1014, 9},
+ {"UTF-16", 1015, 6},
+ {"csUTF16", 1015, 7},
+ {"CESU-8", 1016, 6},
+ {"csCESU8", 1016, 7},
+ {"csCESU-8", 1016, 8},
+ {"UTF-32", 1017, 6},
+ {"csUTF32", 1017, 7},
+ {"UTF-32BE", 1018, 8},
+ {"csUTF32BE", 1018, 9},
+ {"UTF-32LE", 1019, 8},
+ {"csUTF32LE", 1019, 9},
+ {"BOCU-1", 1020, 6},
+ {"csBOCU1", 1020, 7},
+ {"csBOCU-1", 1020, 8},
+ {"UTF-7-IMAP", 1021, 10},
+ {"csUTF7IMAP", 1021, 10},
+ {"ISO-8859-1-Windows-3.0-Latin-1", 2000, 30},
+ {"csWindows30Latin1", 2000, 17},
+ {"ISO-8859-1-Windows-3.1-Latin-1", 2001, 30},
+ {"csWindows31Latin1", 2001, 17},
+ {"ISO-8859-2-Windows-Latin-2", 2002, 26},
+ {"csWindows31Latin2", 2002, 17},
+ {"ISO-8859-9-Windows-Latin-5", 2003, 26},
+ {"csWindows31Latin5", 2003, 17},
+ {"hp-roman8", 2004, 9},
+ {"roman8", 2004, 6},
+ {"r8", 2004, 2},
+ {"csHPRoman8", 2004, 10},
+ {"Adobe-Standard-Encoding", 2005, 23},
+ {"csAdobeStandardEncoding", 2005, 23},
+ {"Ventura-US", 2006, 10},
+ {"csVenturaUS", 2006, 11},
+ {"Ventura-International", 2007, 21},
+ {"csVenturaInternational", 2007, 22},
+ {"DEC-MCS", 2008, 7},
+ {"dec", 2008, 3},
+ {"csDECMCS", 2008, 8},
+ {"IBM850", 2009, 6},
+ {"cp850", 2009, 5},
+ {"850", 2009, 3},
+ {"csPC850Multilingual", 2009, 19},
+ {"IBM852", 2010, 6},
+ {"cp852", 2010, 5},
+ {"852", 2010, 3},
+ {"csPCp852", 2010, 8},
+ {"IBM437", 2011, 6},
+ {"cp437", 2011, 5},
+ {"437", 2011, 3},
+ {"csPC8CodePage437", 2011, 16},
+ {"PC8-Danish-Norwegian", 2012, 20},
+ {"csPC8DanishNorwegian", 2012, 20},
+ {"IBM862", 2013, 6},
+ {"cp862", 2013, 5},
+ {"862", 2013, 3},
+ {"csPC862LatinHebrew", 2013, 18},
+ {"PC8-Turkish", 2014, 11},
+ {"csPC8Turkish", 2014, 12},
+ {"IBM-Symbols", 2015, 11},
+ {"csIBMSymbols", 2015, 12},
+ {"IBM-Thai", 2016, 8},
+ {"csIBMThai", 2016, 9},
+ {"HP-Legal", 2017, 8},
+ {"csHPLegal", 2017, 9},
+ {"HP-Pi-font", 2018, 10},
+ {"csHPPiFont", 2018, 10},
+ {"HP-Math8", 2019, 8},
+ {"csHPMath8", 2019, 9},
+ {"Adobe-Symbol-Encoding", 2020, 21},
+ {"csHPPSMath", 2020, 10},
+ {"HP-DeskTop", 2021, 10},
+ {"csHPDesktop", 2021, 11},
+ {"Ventura-Math", 2022, 12},
+ {"csVenturaMath", 2022, 13},
+ {"Microsoft-Publishing", 2023, 20},
+ {"csMicrosoftPublishing", 2023, 21},
+ {"Windows-31J", 2024, 11},
+ {"csWindows31J", 2024, 12},
+ {"GB2312", 2025, 6},
+ {"csGB2312", 2025, 8},
+ {"Big5", 2026, 4},
+ {"csBig5", 2026, 6},
+ {"macintosh", 2027, 9},
+ {"mac", 2027, 3},
+ {"csMacintosh", 2027, 11},
+ {"IBM037", 2028, 6},
+ {"cp037", 2028, 5},
+ {"ebcdic-cp-us", 2028, 12},
+ {"ebcdic-cp-ca", 2028, 12},
+ {"ebcdic-cp-wt", 2028, 12},
+ {"ebcdic-cp-nl", 2028, 12},
+ {"csIBM037", 2028, 8},
+ {"IBM038", 2029, 6},
+ {"EBCDIC-INT", 2029, 10},
+ {"cp038", 2029, 5},
+ {"csIBM038", 2029, 8},
+ {"IBM273", 2030, 6},
+ {"CP273", 2030, 5},
+ {"csIBM273", 2030, 8},
+ {"IBM274", 2031, 6},
+ {"EBCDIC-BE", 2031, 9},
+ {"CP274", 2031, 5},
+ {"csIBM274", 2031, 8},
+ {"IBM275", 2032, 6},
+ {"EBCDIC-BR", 2032, 9},
+ {"cp275", 2032, 5},
+ {"csIBM275", 2032, 8},
+ {"IBM277", 2033, 6},
+ {"EBCDIC-CP-DK", 2033, 12},
+ {"EBCDIC-CP-NO", 2033, 12},
+ {"csIBM277", 2033, 8},
+ {"IBM278", 2034, 6},
+ {"CP278", 2034, 5},
+ {"ebcdic-cp-fi", 2034, 12},
+ {"ebcdic-cp-se", 2034, 12},
+ {"csIBM278", 2034, 8},
+ {"IBM280", 2035, 6},
+ {"CP280", 2035, 5},
+ {"ebcdic-cp-it", 2035, 12},
+ {"csIBM280", 2035, 8},
+ {"IBM281", 2036, 6},
+ {"EBCDIC-JP-E", 2036, 11},
+ {"cp281", 2036, 5},
+ {"csIBM281", 2036, 8},
+ {"IBM284", 2037, 6},
+ {"CP284", 2037, 5},
+ {"ebcdic-cp-es", 2037, 12},
+ {"csIBM284", 2037, 8},
+ {"IBM285", 2038, 6},
+ {"CP285", 2038, 5},
+ {"ebcdic-cp-gb", 2038, 12},
+ {"csIBM285", 2038, 8},
+ {"IBM290", 2039, 6},
+ {"cp290", 2039, 5},
+ {"EBCDIC-JP-kana", 2039, 14},
+ {"csIBM290", 2039, 8},
+ {"IBM297", 2040, 6},
+ {"cp297", 2040, 5},
+ {"ebcdic-cp-fr", 2040, 12},
+ {"csIBM297", 2040, 8},
+ {"IBM420", 2041, 6},
+ {"cp420", 2041, 5},
+ {"ebcdic-cp-ar1", 2041, 13},
+ {"csIBM420", 2041, 8},
+ {"IBM423", 2042, 6},
+ {"cp423", 2042, 5},
+ {"ebcdic-cp-gr", 2042, 12},
+ {"csIBM423", 2042, 8},
+ {"IBM424", 2043, 6},
+ {"cp424", 2043, 5},
+ {"ebcdic-cp-he", 2043, 12},
+ {"csIBM424", 2043, 8},
+ {"IBM500", 2044, 6},
+ {"CP500", 2044, 5},
+ {"ebcdic-cp-be", 2044, 12},
+ {"ebcdic-cp-ch", 2044, 12},
+ {"csIBM500", 2044, 8},
+ {"IBM851", 2045, 6},
+ {"cp851", 2045, 5},
+ {"851", 2045, 3},
+ {"csIBM851", 2045, 8},
+ {"IBM855", 2046, 6},
+ {"cp855", 2046, 5},
+ {"855", 2046, 3},
+ {"csIBM855", 2046, 8},
+ {"IBM857", 2047, 6},
+ {"cp857", 2047, 5},
+ {"857", 2047, 3},
+ {"csIBM857", 2047, 8},
+ {"IBM860", 2048, 6},
+ {"cp860", 2048, 5},
+ {"860", 2048, 3},
+ {"csIBM860", 2048, 8},
+ {"IBM861", 2049, 6},
+ {"cp861", 2049, 5},
+ {"861", 2049, 3},
+ {"cp-is", 2049, 5},
+ {"csIBM861", 2049, 8},
+ {"IBM863", 2050, 6},
+ {"cp863", 2050, 5},
+ {"863", 2050, 3},
+ {"csIBM863", 2050, 8},
+ {"IBM864", 2051, 6},
+ {"cp864", 2051, 5},
+ {"csIBM864", 2051, 8},
+ {"IBM865", 2052, 6},
+ {"cp865", 2052, 5},
+ {"865", 2052, 3},
+ {"csIBM865", 2052, 8},
+ {"IBM868", 2053, 6},
+ {"CP868", 2053, 5},
+ {"cp-ar", 2053, 5},
+ {"csIBM868", 2053, 8},
+ {"IBM869", 2054, 6},
+ {"cp869", 2054, 5},
+ {"869", 2054, 3},
+ {"cp-gr", 2054, 5},
+ {"csIBM869", 2054, 8},
+ {"IBM870", 2055, 6},
+ {"CP870", 2055, 5},
+ {"ebcdic-cp-roece", 2055, 15},
+ {"ebcdic-cp-yu", 2055, 12},
+ {"csIBM870", 2055, 8},
+ {"IBM871", 2056, 6},
+ {"CP871", 2056, 5},
+ {"ebcdic-cp-is", 2056, 12},
+ {"csIBM871", 2056, 8},
+ {"IBM880", 2057, 6},
+ {"cp880", 2057, 5},
+ {"EBCDIC-Cyrillic", 2057, 15},
+ {"csIBM880", 2057, 8},
+ {"IBM891", 2058, 6},
+ {"cp891", 2058, 5},
+ {"csIBM891", 2058, 8},
+ {"IBM903", 2059, 6},
+ {"cp903", 2059, 5},
+ {"csIBM903", 2059, 8},
+ {"IBM904", 2060, 6},
+ {"cp904", 2060, 5},
+ {"904", 2060, 3},
+ {"csIBBM904", 2060, 9},
+ {"IBM905", 2061, 6},
+ {"CP905", 2061, 5},
+ {"ebcdic-cp-tr", 2061, 12},
+ {"csIBM905", 2061, 8},
+ {"IBM918", 2062, 6},
+ {"CP918", 2062, 5},
+ {"ebcdic-cp-ar2", 2062, 13},
+ {"csIBM918", 2062, 8},
+ {"IBM1026", 2063, 7},
+ {"CP1026", 2063, 6},
+ {"csIBM1026", 2063, 9},
+ {"EBCDIC-AT-DE", 2064, 12},
+ {"csIBMEBCDICATDE", 2064, 15},
+ {"EBCDIC-AT-DE-A", 2065, 14},
+ {"csEBCDICATDEA", 2065, 13},
+ {"EBCDIC-CA-FR", 2066, 12},
+ {"csEBCDICCAFR", 2066, 12},
+ {"EBCDIC-DK-NO", 2067, 12},
+ {"csEBCDICDKNO", 2067, 12},
+ {"EBCDIC-DK-NO-A", 2068, 14},
+ {"csEBCDICDKNOA", 2068, 13},
+ {"EBCDIC-FI-SE", 2069, 12},
+ {"csEBCDICFISE", 2069, 12},
+ {"EBCDIC-FI-SE-A", 2070, 14},
+ {"csEBCDICFISEA", 2070, 13},
+ {"EBCDIC-FR", 2071, 9},
+ {"csEBCDICFR", 2071, 10},
+ {"EBCDIC-IT", 2072, 9},
+ {"csEBCDICIT", 2072, 10},
+ {"EBCDIC-PT", 2073, 9},
+ {"csEBCDICPT", 2073, 10},
+ {"EBCDIC-ES", 2074, 9},
+ {"csEBCDICES", 2074, 10},
+ {"EBCDIC-ES-A", 2075, 11},
+ {"csEBCDICESA", 2075, 11},
+ {"EBCDIC-ES-S", 2076, 11},
+ {"csEBCDICESS", 2076, 11},
+ {"EBCDIC-UK", 2077, 9},
+ {"csEBCDICUK", 2077, 10},
+ {"EBCDIC-US", 2078, 9},
+ {"csEBCDICUS", 2078, 10},
+ {"UNKNOWN-8BIT", 2079, 12},
+ {"csUnknown8BiT", 2079, 13},
+ {"MNEMONIC", 2080, 8},
+ {"csMnemonic", 2080, 10},
+ {"MNEM", 2081, 4},
+ {"csMnem", 2081, 6},
+ {"VISCII", 2082, 6},
+ {"csVISCII", 2082, 8},
+ {"VIQR", 2083, 4},
+ {"csVIQR", 2083, 6},
+ {"KOI8-R", 2084, 6},
+ {"csKOI8R", 2084, 7},
+ {"HZ-GB-2312", 2085, 10},
+ {"IBM866", 2086, 6},
+ {"cp866", 2086, 5},
+ {"866", 2086, 3},
+ {"csIBM866", 2086, 8},
+ {"IBM775", 2087, 6},
+ {"cp775", 2087, 5},
+ {"csPC775Baltic", 2087, 13},
+ {"KOI8-U", 2088, 6},
+ {"csKOI8U", 2088, 7},
+ {"IBM00858", 2089, 8},
+ {"CCSID00858", 2089, 10},
+ {"CP00858", 2089, 7},
+ {"PC-Multilingual-850+euro", 2089, 24},
+ {"csIBM00858", 2089, 10},
+ {"IBM00924", 2090, 8},
+ {"CCSID00924", 2090, 10},
+ {"CP00924", 2090, 7},
+ {"ebcdic-Latin9--euro", 2090, 19},
+ {"csIBM00924", 2090, 10},
+ {"IBM01140", 2091, 8},
+ {"CCSID01140", 2091, 10},
+ {"CP01140", 2091, 7},
+ {"ebcdic-us-37+euro", 2091, 17},
+ {"csIBM01140", 2091, 10},
+ {"IBM01141", 2092, 8},
+ {"CCSID01141", 2092, 10},
+ {"CP01141", 2092, 7},
+ {"ebcdic-de-273+euro", 2092, 18},
+ {"csIBM01141", 2092, 10},
+ {"IBM01142", 2093, 8},
+ {"CCSID01142", 2093, 10},
+ {"CP01142", 2093, 7},
+ {"ebcdic-dk-277+euro", 2093, 18},
+ {"ebcdic-no-277+euro", 2093, 18},
+ {"csIBM01142", 2093, 10},
+ {"IBM01143", 2094, 8},
+ {"CCSID01143", 2094, 10},
+ {"CP01143", 2094, 7},
+ {"ebcdic-fi-278+euro", 2094, 18},
+ {"ebcdic-se-278+euro", 2094, 18},
+ {"csIBM01143", 2094, 10},
+ {"IBM01144", 2095, 8},
+ {"CCSID01144", 2095, 10},
+ {"CP01144", 2095, 7},
+ {"ebcdic-it-280+euro", 2095, 18},
+ {"csIBM01144", 2095, 10},
+ {"IBM01145", 2096, 8},
+ {"CCSID01145", 2096, 10},
+ {"CP01145", 2096, 7},
+ {"ebcdic-es-284+euro", 2096, 18},
+ {"csIBM01145", 2096, 10},
+ {"IBM01146", 2097, 8},
+ {"CCSID01146", 2097, 10},
+ {"CP01146", 2097, 7},
+ {"ebcdic-gb-285+euro", 2097, 18},
+ {"csIBM01146", 2097, 10},
+ {"IBM01147", 2098, 8},
+ {"CCSID01147", 2098, 10},
+ {"CP01147", 2098, 7},
+ {"ebcdic-fr-297+euro", 2098, 18},
+ {"csIBM01147", 2098, 10},
+ {"IBM01148", 2099, 8},
+ {"CCSID01148", 2099, 10},
+ {"CP01148", 2099, 7},
+ {"ebcdic-international-500+euro", 2099, 29},
+ {"csIBM01148", 2099, 10},
+ {"IBM01149", 2100, 8},
+ {"CCSID01149", 2100, 10},
+ {"CP01149", 2100, 7},
+ {"ebcdic-is-871+euro", 2100, 18},
+ {"csIBM01149", 2100, 10},
+ {"Big5-HKSCS", 2101, 10},
+ {"csBig5HKSCS", 2101, 11},
+ {"IBM1047", 2102, 7},
+ {"IBM-1047", 2102, 8},
+ {"csIBM1047", 2102, 9},
+ {"PTCP154", 2103, 7},
+ {"csPTCP154", 2103, 9},
+ {"PT154", 2103, 5},
+ {"CP154", 2103, 5},
+ {"Cyrillic-Asian", 2103, 14},
+ {"Amiga-1251", 2104, 10},
+ {"Ami1251", 2104, 7},
+ {"Amiga1251", 2104, 9},
+ {"Ami-1251", 2104, 8},
+ {"csAmiga1251", 2104, 11},
+ {"KOI7-switched", 2105, 13},
+ {"csKOI7switched", 2105, 14},
+ {"BRF", 2106, 3},
+ {"csBRF", 2106, 5},
+ {"TSCII", 2107, 5},
+ {"csTSCII", 2107, 7},
+ {"CP51932", 2108, 7},
+ {"csCP51932", 2108, 9},
+ {"windows-874", 2109, 11},
+ {"cswindows874", 2109, 12},
+ {"windows-1250", 2250, 12},
+ {"cswindows1250", 2250, 13},
+ {"windows-1251", 2251, 12},
+ {"cswindows1251", 2251, 13},
+ {"windows-1252", 2252, 12},
+ {"cswindows1252", 2252, 13},
+ {"windows-1253", 2253, 12},
+ {"cswindows1253", 2253, 13},
+ {"windows-1254", 2254, 12},
+ {"cswindows1254", 2254, 13},
+ {"windows-1255", 2255, 12},
+ {"cswindows1255", 2255, 13},
+ {"windows-1256", 2256, 12},
+ {"cswindows1256", 2256, 13},
+ {"windows-1257", 2257, 12},
+ {"cswindows1257", 2257, 13},
+ {"windows-1258", 2258, 12},
+ {"cswindows1258", 2258, 13},
+ {"TIS-620", 2259, 7},
+ {"csTIS620", 2259, 8},
+ {"ISO-8859-11", 2259, 11},
+ {"CP50220", 2260, 7},
+ {"csCP50220", 2260, 9},
+ };
+
+ friend struct text_encoding;
+
+ const __encoding_data* __encoding_rep_ = __text_encoding_data + 1;
+ char __name_[__max_name_length_ + 1] = {0};
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif
+
+_LIBCPP_POP_MACROS
+
+#endif // _LIBCPP___TEXT_ENCODING_TEXT_ENCODING_REP_H
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index 9ecd0ff827700..90f9d2cbc21f7 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -2081,7 +2081,7 @@ module std [system] {
}
module text_encoding {
- module get_locale_encoding { header "__text_encoding/get_locale_encoding.h" }
+ module text_encoding_rep { header "__text_encoding/text_encoding_rep.h" }
module text_encoding { header "__text_encoding/text_encoding.h" }
header "text_encoding"
diff --git a/libcxx/include/text_encoding b/libcxx/include/text_encoding
index b41913a57bd72..969dd85ad7032 100644
--- a/libcxx/include/text_encoding
+++ b/libcxx/include/text_encoding
@@ -57,14 +57,23 @@ struct text_encoding
*/
-#include <__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-#if _LIBCPP_STD_VER >= 26
-# include <__text_encoding/text_encoding.h>
-#endif // _LIBCPP_STD_VER >= 26
+#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+# include <__cxx03/__config>
+#else
+# include <__config>
+
+# if _LIBCPP_STD_VER >= 23
+# include <__text_encoding/text_encoding_rep.h>
+# if _LIBCPP_STD_VER >= 26
+# include <__text_encoding/text_encoding.h>
+# endif // _LIBCPP_STD_VER >= 26
+# endif
+
+# include <version>
+
+# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+# endif
+#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
#endif // _LIBCPP_TEXT_ENCODING
diff --git a/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
index 2b85596bd87f6..47c87e5439a5a 100644
--- a/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -96,6 +96,7 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE6do_outERPcPKwS5_RS5_S2_S2_S3_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthERPcPKcS5_m', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__115error_condition7messageEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
+{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__117bad_function_call4whatEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__118__time_get_storageIcE15__do_date_orderEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__118__time_get_storageIwE15__do_date_orderEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
@@ -410,6 +411,7 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__112system_errorD0Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__112system_errorD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__112system_errorD2Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
+{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113__hash_memoryEPKvm', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113random_deviceD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
@@ -418,7 +420,6 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED2Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113shared_futureIvEaSERKS1_', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__113__hash_memoryEPKvm', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__114__num_get_base5__srcE', 'storage_mapping_class': 'RO', 'type': 'OBJECT'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__114__num_put_base12__format_intEPcPKcbj', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
@@ -503,7 +504,6 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117bad_function_callD0Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117bad_function_callD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117bad_function_callD2Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNKSt3__117bad_function_call4whatEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117iostream_categoryEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
@@ -555,6 +555,7 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEEi', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvi', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
+{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
diff --git a/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
index 88abb71fc9bc7..5521b4a605bfb 100644
--- a/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -555,7 +555,7 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIlNS_22__cxx_atomic_base_implIlEEEEl', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvl', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingB8ne210000EPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
+{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
diff --git a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
index e4ec115d736bc..b615c89932668 100644
--- a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -35,7 +35,6 @@
{'is_defined': False, 'name': '_ZTVSt13runtime_error', 'size': 0, 'type': 'OBJECT'}
{'is_defined': False, 'name': '_ZTVSt14overflow_error', 'size': 0, 'type': 'OBJECT'}
{'is_defined': False, 'name': '_ZTVSt16invalid_argument', 'size': 0, 'type': 'OBJECT'}
-{'is_defined': False, 'name': '_ZTVSt9exception', 'size': 0, 'type': 'OBJECT'}
{'is_defined': False, 'name': '_ZdaPv', 'type': 'FUNC'}
{'is_defined': False, 'name': '_ZdaPvSt11align_val_t', 'type': 'FUNC'}
{'is_defined': False, 'name': '_ZdlPv', 'type': 'FUNC'}
@@ -1215,7 +1214,7 @@
{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEEi', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvi', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingB8ne210000EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'type': 'FUNC'}
@@ -1966,8 +1965,6 @@
{'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 96, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 96, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 96, 'type': 'OBJECT'}
-{'is_defined': True, 'name': '_ZTVNSt3__120__time_get_c_storageIcEE', 'size': 72, 'type': 'OBJECT'}
-{'is_defined': True, 'name': '_ZTVNSt3__120__time_get_c_storageIwEE', 'size': 72, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZTVNSt3__13pmr15memory_resourceE', 'size': 56, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZTVNSt3__13pmr25monotonic_buffer_resourceE', 'size': 56, 'type': 'OBJECT'}
{'is_defined': True, 'name': '_ZTVNSt3__13pmr26synchronized_pool_resourceE', 'size': 56, 'type': 'OBJECT'}
@@ -2028,4 +2025,4 @@
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
\ No newline at end of file
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
diff --git a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist
index 51caa07a74330..f38e0b2e6dfb6 100644
--- a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist
+++ b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist
@@ -1185,6 +1185,7 @@
{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEEi', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvi', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'type': 'FUNC'}
@@ -1995,4 +1996,4 @@
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
\ No newline at end of file
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
diff --git a/libcxx/src/text_encoding.cpp b/libcxx/src/text_encoding.cpp
index d02c4c1b566a5..8fc999b9196ec 100644
--- a/libcxx/src/text_encoding.cpp
+++ b/libcxx/src/text_encoding.cpp
@@ -6,26 +6,320 @@
//
//===----------------------------------------------------------------------===//
-#include <__config>
-
-#include <__locale_dir/locale_base_api.h>
-#include <__text_encoding/get_locale_encoding.h>
+#include <text_encoding>
+#if defined(_LIBCPP_WIN32API)
+# include <windows.h>
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
-_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
-string_view __get_locale_encoding(const char* __name) {
- std::string_view __encoding_str{""};
- if (auto __loc = __locale::__newlocale(LC_CTYPE_MASK, __name, static_cast<locale_t>(0))) {
+__text_encoding_rep __text_encoding_rep::__get_locale_encoding(const char* __name) {
+#if defined(_LIBCPP_WIN32API)
+ auto _code_page = GetACP();
+ auto __mib = __text_encoding_rep::__id::other;
+
+ switch (_code_page) {
+ __mib = __text_encoding_rep::__id::IBM037;
+ break;
+ case 437:
+ __mib = __text_encoding_rep::__id::PC8CodePage437;
+ break;
+ case 500:
+ __mib = __text_encoding_rep::__id::IBM500;
+ break;
+ case 708:
+ __mib = __text_encoding_rep::__id::ISOLatinArabic;
+ break;
+ case 709:
+ __mib = __text_encoding_rep::__id::ISO89ASMO449;
+ break;
+ case 775:
+ __mib = __text_encoding_rep::__id::PC775Baltic;
+ break;
+ case 850:
+ __mib = __text_encoding_rep::__id::PC850Multilingual;
+ break;
+ case 852:
+ __mib = __text_encoding_rep::__id::PCp852;
+ break;
+ case 855:
+ __mib = __text_encoding_rep::__id::IBM855;
+ break;
+ case 857:
+ __mib = __text_encoding_rep::__id::IBM857;
+ break;
+ case 858:
+ __mib = __text_encoding_rep::__id::IBM00858;
+ break;
+ case 860:
+ __mib = __text_encoding_rep::__id::IBM860;
+ break;
+ case 861:
+ __mib = __text_encoding_rep::__id::IBM861;
+ break;
+ case 862:
+ __mib = __text_encoding_rep::__id::PC862LatinHebrew;
+ break;
+ case 863:
+ __mib = __text_encoding_rep::__id::IBM863;
+ break;
+ case 864:
+ __mib = __text_encoding_rep::__id::IBM864;
+ break;
+ case 865:
+ __mib = __text_encoding_rep::__id::IBM865;
+ break;
+ case 865:
+ __mib = __text_encoding_rep::__id::IBM865;
+ break;
+ case 866:
+ __mib = __text_encoding_rep::__id::IBM866;
+ break;
+ case 869:
+ __mib = __text_encoding_rep::__id::IBM869;
+ break;
+ case 870:
+ __mib = __text_encoding_rep::__id::IBM870;
+ break;
+ case 874:
+ __mib = __text_encoding_rep::__id::windows874;
+ break;
+ case 932:
+ __mib = __text_encoding_rep::__id::ShiftJIS;
+ break;
+ case 936:
+ __mib = __text_encoding_rep::__id::GB2312;
+ break;
+ case 949:
+ __mib = __text_encoding_rep::__id::KSC56011987;
+ break;
+ case 950:
+ __mib = __text_encoding_rep::__id::Big5;
+ break;
+ case 1026:
+ __mib = __text_encoding_rep::__id::IBM1026;
+ break;
+ case 1047:
+ __mib = __text_encoding_rep::__id::IBM1047;
+ break;
+ case 1140:
+ __mib = __text_encoding_rep::__id::IBM01140;
+ break;
+ case 1141:
+ __mib = __text_encoding_rep::__id::IBM01141;
+ break;
+ case 1142:
+ __mib = __text_encoding_rep::__id::IBM01142;
+ break;
+ case 1143:
+ __mib = __text_encoding_rep::__id::IBM01143;
+ break;
+ case 1144:
+ __mib = __text_encoding_rep::__id::IBM01144;
+ break;
+ case 1145:
+ __mib = __text_encoding_rep::__id::IBM01145;
+ break;
+ case 1146:
+ __mib = __text_encoding_rep::__id::IBM01146;
+ break;
+ case 1146:
+ __mib = __text_encoding_rep::__id::IBM01146;
+ break;
+ case 1147:
+ __mib = __text_encoding_rep::__id::IBM01147;
+ break;
+ case 1148:
+ __mib = __text_encoding_rep::__id::IBM01148;
+ break;
+ case 1149:
+ __mib = __text_encoding_rep::__id::IBM01149;
+ break;
+ case 1200:
+ __mib = __text_encoding_rep::__id::UTF16LE;
+ break;
+ case 1201:
+ __mib = __text_encoding_rep::__id::UTF16BE;
+ break;
+ case 1250:
+ __mib = __text_encoding_rep::__id::windows1250;
+ break;
+ case 1251:
+ __mib = __text_encoding_rep::__id::windows1251;
+ break;
+ case 1252:
+ __mib = __text_encoding_rep::__id::windows1252;
+ break;
+ case 1253:
+ __mib = __text_encoding_rep::__id::windows1253;
+ break;
+ case 1254:
+ __mib = __text_encoding_rep::__id::windows1254;
+ break;
+ case 1255:
+ __mib = __text_encoding_rep::__id::windows1255;
+ break;
+ case 1256:
+ __mib = __text_encoding_rep::__id::windows1256;
+ break;
+ case 1257:
+ __mib = __text_encoding_rep::__id::windows1257;
+ break;
+ case 1258:
+ __mib = __text_encoding_rep::__id::windows1258;
+ break;
+ case 10000:
+ __mib = __text_encoding_rep::__id::Macintosh;
+ break;
+ case 12000:
+ __mib = __text_encoding_rep::__id::UTF32LE;
+ break;
+ case 12001:
+ __mib = __text_encoding_rep::__id::UTF32BE;
+ break;
+ case 20127:
+ __mib = __text_encoding_rep::__id::ASCII;
+ break;
+ case 20273:
+ __mib = __text_encoding_rep::__id::IBM273;
+ break;
+ case 20277:
+ __mib = __text_encoding_rep::__id::IBM277;
+ break;
+ case 20278:
+ __mib = __text_encoding_rep::__id::IBM278;
+ break;
+ case 20280:
+ __mib = __text_encoding_rep::__id::IBM280;
+ break;
+ case 20284:
+ __mib = __text_encoding_rep::__id::IBM284;
+ break;
+ case 20285:
+ __mib = __text_encoding_rep::__id::IBM285;
+ break;
+ case 20290:
+ __mib = __text_encoding_rep::__id::IBM290;
+ break;
+ case 20297:
+ __mib = __text_encoding_rep::__id::IBM297;
+ break;
+ case 20420:
+ __mib = __text_encoding_rep::__id::IBM420;
+ break;
+ case 20423:
+ __mib = __text_encoding_rep::__id::IBM423;
+ break;
+ case 20424:
+ __mib = __text_encoding_rep::__id::IBM424;
+ break;
+ case 20838:
+ __mib = __text_encoding_rep::__id::IBMThai;
+ break;
+ case 20866:
+ __mib = __text_encoding_rep::__id::KOI8R;
+ break;
+ case 20871:
+ __mib = __text_encoding_rep::__id::IBM871;
+ break;
+ case 20880:
+ __mib = __text_encoding_rep::__id::IBM880;
+ break;
+ case 20905:
+ __mib = __text_encoding_rep::__id::IBM905;
+ break;
+ case 20924:
+ __mib = __text_encoding_rep::__id::IBM00924;
+ break;
+ case 20932:
+ __mib = __text_encoding_rep::__id::EUCPkdFmtJapanese;
+ break;
+ case 21866:
+ __mib = __text_encoding_rep::__id::KOI8U;
+ break;
+ case 28591:
+ __mib = __text_encoding_rep::__id::ISOLatin1;
+ break;
+ case 28592:
+ __mib = __text_encoding_rep::__id::ISOLatin2;
+ break;
+ case 28593:
+ __mib = __text_encoding_rep::__id::ISOLatin3;
+ break;
+ case 28594:
+ __mib = __text_encoding_rep::__id::ISOLatin4;
+ break;
+ case 28595:
+ __mib = __text_encoding_rep::__id::ISOLatin5;
+ break;
+ case 28596:
+ __mib = __text_encoding_rep::__id::ISOLatin6;
+ break;
+ case 28597:
+ __mib = __text_encoding_rep::__id::ISOLatinGreek;
+ break;
+ case 28598:
+ __mib = __text_encoding_rep::__id::ISOLatinHebrew;
+ break;
+ case 28599:
+ __mib = __text_encoding_rep::__id::Windows31Latin5;
+ break;
+ case 28603:
+ __mib = __text_encoding_rep::__id::ISO885913;
+ break;
+ case 28605:
+ __mib = __text_encoding_rep::__id::ISO885915;
+ break;
+ case 38598:
+ __mib = __text_encoding_rep::__id::ISO88598I;
+ break;
+ case 50220:
+ __mib = __text_encoding_rep::__id::ISO2022JP;
+ break;
+ case 50221:
+ __mib = __text_encoding_rep::__id::ISO2022JP;
+ break;
+ case 50222:
+ __mib = __text_encoding_rep::__id::ISO2022JP;
+ break;
+ case 51932:
+ __mib = __text_encoding_rep::__id::EUCPkdFmtJapanese;
+ break;
+ case 51936:
+ __mib = __text_encoding_rep::__id::GB2312;
+ break;
+ case 51949:
+ __mib = __text_encoding_rep::__id::EUCKR;
+ break;
+ case 52936:
+ __mib = __text_encoding_rep::__id::HZGB2312;
+ break;
+ case 54936:
+ __mib = __text_encoding_rep::__id::GB18030;
+ break;
+ case 65000:
+ __mib = __text_encoding_rep::__id::UTF7;
+ break;
+ case 65001:
+ __mib = __text_encoding_rep::__id::UTF8;
+ break;
+ default:
+ __mib = __text_encoding_rep::__id::other;
+ break;
+ };
+ return __text_encoding_rep(__mib);
+#else
+ __text_encoding_rep __encoding{};
+ if (auto __loc = __locale::__newlocale(_LIBCPP_CTYPE_MASK, __name, static_cast<__locale::__locale_t>(0))) {
if (const char* __codeset = __locale::__nl_langinfo_l(CODESET, __loc)) {
string_view __s(__codeset);
- if (__s.size() < 63)
- __encoding_str = __s;
+ if (__s.size() <= __text_encoding_rep::__max_name_length_)
+ __encoding = __text_encoding_rep(__s);
}
__locale::__freelocale(__loc);
}
- return __encoding_str;
+ return __encoding;
+#endif
}
-_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/test/libcxx/transitive_includes/cxx03.csv b/libcxx/test/libcxx/transitive_includes/cxx03.csv
index c0031543e47bc..51d78b178a3b6 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx03.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx03.csv
@@ -2282,6 +2282,7 @@ system_error typeinfo
system_error utility
system_error variant
system_error version
+text_encoding version
thread algorithm
thread array
thread atomic
diff --git a/libcxx/test/libcxx/transitive_includes/cxx11.csv b/libcxx/test/libcxx/transitive_includes/cxx11.csv
index c0031543e47bc..51d78b178a3b6 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx11.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx11.csv
@@ -2282,6 +2282,7 @@ system_error typeinfo
system_error utility
system_error variant
system_error version
+text_encoding version
thread algorithm
thread array
thread atomic
diff --git a/libcxx/test/libcxx/transitive_includes/cxx14.csv b/libcxx/test/libcxx/transitive_includes/cxx14.csv
index c2eb5b44e8d7a..a4f99846c898c 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx14.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx14.csv
@@ -2328,6 +2328,7 @@ system_error typeinfo
system_error utility
system_error variant
system_error version
+text_encoding version
thread algorithm
thread array
thread atomic
diff --git a/libcxx/test/libcxx/transitive_includes/cxx17.csv b/libcxx/test/libcxx/transitive_includes/cxx17.csv
index 332cb62f35b5f..2a1d3be84d66f 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx17.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx17.csv
@@ -2335,6 +2335,7 @@ system_error typeinfo
system_error utility
system_error variant
system_error version
+text_encoding version
thread algorithm
thread array
thread atomic
diff --git a/libcxx/test/libcxx/transitive_includes/cxx20.csv b/libcxx/test/libcxx/transitive_includes/cxx20.csv
index 55c79acff5a8f..b5b36902d6fe8 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx20.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx20.csv
@@ -2365,6 +2365,7 @@ system_error typeinfo
system_error utility
system_error variant
system_error version
+text_encoding version
thread algorithm
thread array
thread atomic
diff --git a/libcxx/test/libcxx/transitive_includes/cxx23.csv b/libcxx/test/libcxx/transitive_includes/cxx23.csv
index cb23c7a98de1b..26809ccdcd379 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx23.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx23.csv
@@ -1065,6 +1065,21 @@ system_error string
system_error string_view
system_error tuple
system_error version
+text_encoding cctype
+text_encoding clocale
+text_encoding compare
+text_encoding cstdint
+text_encoding cstdio
+text_encoding cstdlib
+text_encoding cstring
+text_encoding cwchar
+text_encoding cwctype
+text_encoding initializer_list
+text_encoding iosfwd
+text_encoding limits
+text_encoding stdexcept
+text_encoding string_view
+text_encoding version
thread array
thread atomic
thread bitset
diff --git a/libcxx/test/libcxx/transitive_includes/cxx26.csv b/libcxx/test/libcxx/transitive_includes/cxx26.csv
index 94b06b8bcb444..bc6e1035f701d 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx26.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx26.csv
@@ -88,6 +88,7 @@ ccomplex stdexcept
ccomplex streambuf
ccomplex string
ccomplex string_view
+ccomplex text_encoding
ccomplex tuple
ccomplex typeinfo
ccomplex version
@@ -126,6 +127,7 @@ chrono stdexcept
chrono streambuf
chrono string
chrono string_view
+chrono text_encoding
chrono tuple
chrono typeinfo
chrono version
@@ -149,6 +151,7 @@ codecvt limits
codecvt stdexcept
codecvt string
codecvt string_view
+codecvt text_encoding
codecvt tuple
codecvt typeinfo
codecvt version
@@ -181,6 +184,7 @@ complex stdexcept
complex streambuf
complex string
complex string_view
+complex text_encoding
complex tuple
complex typeinfo
complex version
@@ -229,6 +233,7 @@ ctgmath stdexcept
ctgmath streambuf
ctgmath string
ctgmath string_view
+ctgmath text_encoding
ctgmath tuple
ctgmath typeinfo
ctgmath version
@@ -279,6 +284,7 @@ experimental/iterator stdexcept
experimental/iterator streambuf
experimental/iterator string
experimental/iterator string_view
+experimental/iterator text_encoding
experimental/iterator tuple
experimental/iterator typeinfo
experimental/iterator variant
@@ -323,6 +329,7 @@ filesystem ratio
filesystem stdexcept
filesystem string
filesystem string_view
+filesystem text_encoding
filesystem tuple
filesystem typeinfo
filesystem version
@@ -373,6 +380,7 @@ format optional
format stdexcept
format string
format string_view
+format text_encoding
format tuple
format typeinfo
format version
@@ -410,6 +418,7 @@ fstream stdexcept
fstream streambuf
fstream string
fstream string_view
+fstream text_encoding
fstream tuple
fstream typeinfo
fstream version
@@ -453,6 +462,7 @@ future stdexcept
future streambuf
future string
future string_view
+future text_encoding
future tuple
future typeinfo
future version
@@ -478,6 +488,7 @@ iomanip ratio
iomanip stdexcept
iomanip string
iomanip string_view
+iomanip text_encoding
iomanip tuple
iomanip typeinfo
iomanip version
@@ -501,6 +512,7 @@ ios ratio
ios stdexcept
ios string
ios string_view
+ios text_encoding
ios tuple
ios typeinfo
ios version
@@ -535,6 +547,7 @@ iostream stdexcept
iostream streambuf
iostream string
iostream string_view
+iostream text_encoding
iostream tuple
iostream typeinfo
iostream version
@@ -561,6 +574,7 @@ istream stdexcept
istream streambuf
istream string
istream string_view
+istream text_encoding
istream tuple
istream typeinfo
istream version
@@ -617,6 +631,7 @@ locale stdexcept
locale streambuf
locale string
locale string_view
+locale text_encoding
locale tuple
locale typeinfo
locale version
@@ -718,6 +733,7 @@ ostream stdexcept
ostream streambuf
ostream string
ostream string_view
+ostream text_encoding
ostream tuple
ostream typeinfo
ostream version
@@ -743,6 +759,7 @@ print optional
print stdexcept
print string
print string_view
+print text_encoding
print tuple
print typeinfo
print version
@@ -766,6 +783,7 @@ queue limits
queue stdexcept
queue string
queue string_view
+queue text_encoding
queue tuple
queue typeinfo
queue vector
@@ -832,6 +850,7 @@ regex limits
regex stdexcept
regex string
regex string_view
+regex text_encoding
regex tuple
regex typeinfo
regex vector
@@ -896,6 +915,7 @@ sstream stdexcept
sstream streambuf
sstream string
sstream string_view
+sstream text_encoding
sstream tuple
sstream typeinfo
sstream version
@@ -940,6 +960,7 @@ streambuf ratio
streambuf stdexcept
streambuf string
streambuf string_view
+streambuf text_encoding
streambuf tuple
streambuf typeinfo
streambuf version
@@ -994,6 +1015,7 @@ strstream stdexcept
strstream streambuf
strstream string
strstream string_view
+strstream text_encoding
strstream tuple
strstream typeinfo
strstream version
@@ -1028,6 +1050,7 @@ syncstream stdexcept
syncstream streambuf
syncstream string
syncstream string_view
+syncstream text_encoding
syncstream tuple
syncstream typeinfo
syncstream version
@@ -1049,9 +1072,11 @@ system_error string_view
system_error tuple
system_error version
text_encoding cctype
+text_encoding clocale
text_encoding compare
text_encoding cstdint
text_encoding cstdio
+text_encoding cstdlib
text_encoding cstring
text_encoding cwchar
text_encoding cwctype
@@ -1088,6 +1113,7 @@ thread stdexcept
thread streambuf
thread string
thread string_view
+thread text_encoding
thread tuple
thread typeinfo
thread version
@@ -1157,6 +1183,7 @@ vector limits
vector stdexcept
vector string
vector string_view
+vector text_encoding
vector tuple
vector typeinfo
vector version
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/text_encoding.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/text_encoding.version.compile.pass.cpp
index 817b0f0d655db..1678e8840af8d 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/text_encoding.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/text_encoding.version.compile.pass.cpp
@@ -60,4 +60,3 @@
#endif // TEST_STD_VER > 23
// clang-format on
-
diff --git a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
index 56a9e9f92b446..a83102b43ffc2 100644
--- a/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
@@ -543,7 +543,8 @@ int main(int, char**)
std::noshowbase(ios);
}
{ // negative, showbase
- std::wstring v = convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 \u20ac"); // EURO SIGN
+ std::wstring v =
+ convert_thousands_sep(L"-1" THOUSANDS_SEP_ "234" THOUSANDS_SEP_ "567,89 \u20ac"); // EURO SIGN
std::showbase(ios);
typedef cpp17_input_iterator<const wchar_t*> I;
long double ex;
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp
index 2baa7bd298116..b3bee0f9935e4 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/default.pass.cpp
@@ -10,8 +10,6 @@
// REQUIRES: std-at-least-c++26
-// UNSUPPORTED: no-localization
-
// class text_encoding
// text_encoding::text_encoding() noexcept
@@ -20,10 +18,7 @@
// 1. Default constructor must be nothrow
// 2. Default constructing a text_encoding object makes it so that mib() == id::unknown, and its name is empty
-#include <cassert>
-#include <string_view>
-#include <text_encoding>
-#include <type_traits>
+#include "test_text_encoding.h"
int main(int, char**) {
{
@@ -31,14 +26,11 @@ int main(int, char**) {
std::is_nothrow_default_constructible<std::text_encoding>::value, "Must be nothrow default constructible");
}
- {
- auto te = std::text_encoding();
- assert(te.mib() == std::text_encoding::id::unknown);
- assert(std::string_view("").compare(te.name()) == 0);
- }
{
constexpr auto te = std::text_encoding();
static_assert(te.mib() == std::text_encoding::id::unknown);
static_assert(std::string_view("").compare(te.name()) == 0);
+ assert(te.mib() == std::text_encoding::id::unknown);
+ assert(std::string_view("").compare(te.name()) == 0);
}
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp
index f04e4df1a1d38..83d7c1c733d86 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/id.pass.cpp
@@ -10,8 +10,6 @@
// REQUIRES: std-at-least-c++26
-// UNSUPPORTED: no-localization
-
// class text_encoding
// text_encoding::text_encoding(id) noexcept
@@ -22,18 +20,11 @@
// 3. Constructing an object using id::unknown must set mib() to id::unknown and the name to an empty string.
// 4. Constructing an object using id::other must set mib() to id::other and the name to an empty string.
-#include <algorithm>
-#include <cassert>
-#include <print>
-#include <string_view>
-#include <text_encoding>
-#include <type_traits>
-
#include "test_text_encoding.h"
using te_id = std::text_encoding::id;
-constexpr bool test_ctor(te_id i, te_id expect_id, std::string_view expect_name) {
+constexpr bool id_ctor(te_id i, te_id expect_id, std::string_view expect_name) {
auto te = std::text_encoding(i);
if (te.mib() != expect_id) {
return false;
@@ -47,9 +38,9 @@ constexpr bool test_ctor(te_id i, te_id expect_id, std::string_view expect_name)
return true;
}
-constexpr bool test_ctors_static() {
+constexpr bool id_ctors() {
for (auto pair : unique_encoding_data) {
- if (!test_ctor(te_id{pair.mib}, te_id{pair.mib}, pair.name)) {
+ if (!id_ctor(te_id{pair.mib}, te_id{pair.mib}, pair.name)) {
return false;
}
}
@@ -61,7 +52,10 @@ constexpr bool test_unknown() {
if (te.mib() != te_id::unknown) {
return false;
}
- if (std::string_view(te.name()).compare(te.name()) != 0) {
+ if (std::string_view("").compare(te.name()) != 0) {
+ return false;
+ }
+ if (!std::ranges::empty(te.aliases())) {
return false;
}
return true;
@@ -72,7 +66,10 @@ constexpr bool test_other() {
if (te.mib() != te_id::other) {
return false;
}
- if (std::string_view(te.name()).compare(te.name()) != 0) {
+ if (std::string_view("").compare(te.name()) != 0) {
+ return false;
+ }
+ if (!std::ranges::empty(te.aliases())) {
return false;
}
return true;
@@ -85,28 +82,17 @@ int main() {
}
{
- for (auto pair : unique_encoding_data) {
- assert(test_ctor(te_id{pair.mib}, te_id{pair.mib}, pair.name));
- }
- }
-
- {
- static_assert(test_ctors_static());
+ static_assert(id_ctors());
+ assert(id_ctors());
}
{
static_assert(test_unknown());
- }
-
- {
assert(test_unknown());
}
{
static_assert(test_other());
- }
-
- {
assert(test_other());
}
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp
index 09d86003a4a32..66bbd2a30bead 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.ctor/string_view.pass.cpp
@@ -9,29 +9,26 @@
// <text_encoding>
// REQUIRES: std-at-least-c++26
-
-// UNSUPPORTED: no-localization
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=9000000
// class text_encoding
// text_encoding::text_encoding(string_view) noexcept
-#include <cassert>
-#include <cstring>
-#include <string_view>
-#include <text_encoding>
-#include <type_traits>
-
-#include "test_macros.h"
#include "test_text_encoding.h"
constexpr bool test_ctor(std::string_view str, std::string_view expect, std::text_encoding::id expect_id) {
- auto te = std::text_encoding(str);
- return te.mib() == expect_id && expect.compare(te.name()) == 0;
+ auto te = std::text_encoding(str);
+ bool success = true;
+
+ assert(te.mib() == expect_id);
+ assert(expect.compare(te.name()) == 0);
+
+ return success;
}
-constexpr bool test_correct_encoding_spellings() {
- for (auto pair : unique_encoding_data) {
+constexpr bool test_primary_encoding_spellings() {
+ for (auto& pair : unique_encoding_data) {
if (!test_ctor(pair.name, pair.name, std::text_encoding::id{pair.mib})) {
return false;
}
@@ -39,6 +36,15 @@ constexpr bool test_correct_encoding_spellings() {
return true;
}
+constexpr bool test_others() {
+ for (auto& pair : other_names) {
+ if (!test_ctor(pair, pair, std::text_encoding::other)) {
+ return false;
+ }
+ }
+ return true;
+}
+
int main() {
{
static_assert(std::is_nothrow_constructible<std::text_encoding, std::string_view>::value,
@@ -47,7 +53,7 @@ int main() {
// happy paths
{
- assert(test_correct_encoding_spellings());
+ assert(test_primary_encoding_spellings());
}
{
@@ -79,4 +85,11 @@ int main() {
static_assert(test_ctor("iso00885931988", "iso00885931988", std::text_encoding::ISOLatin3));
assert(test_ctor("iso00885931988", "iso00885931988", std::text_encoding::ISOLatin3));
}
+
+ {
+ static_assert(test_others());
+ assert(test_others());
+ }
+
+ return 0;
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp
index f7b2af8299490..9db681a33b311 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.id.pass.cpp
@@ -10,8 +10,6 @@
// REQUIRES: std-at-least-c++26
-// UNSUPPORTED: no-localization
-
// class text_encoding
// text_encoding operator==(const text_encoding&, id) _NOEXCEPT
@@ -21,14 +19,21 @@
// 2. operator==(const text_encoding&, id) returns true if mib() is equal to the id
// 3. operator==(const text_encoding&, id) returns false if mib() is not equal to the id
-#include <cassert>
-#include <text_encoding>
-
-#include "test_macros.h"
#include "test_text_encoding.h"
using id = std::text_encoding::id;
+constexpr bool test_primary_encodings() {
+ for (auto& data : unique_encoding_data) {
+ auto te = std::text_encoding(id(data.mib));
+ if (te != id(data.mib)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
int main() {
{ // 1
auto te = std::text_encoding();
@@ -64,4 +69,9 @@ int main() {
constexpr auto te = std::text_encoding(id::UTF8);
static_assert(!(te == id::UTF16));
}
+
+ {
+ static_assert(test_primary_encodings());
+ assert(test_primary_encodings());
+ }
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp
index c44bff8239796..78b4e41c950af 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.eq/equal.pass.cpp
@@ -10,8 +10,6 @@
// REQUIRES: std-at-least-c++26
-// UNSUPPORTED: no-localization
-
// class text_encoding
// text_encoding operator==(const text_encoding&, const text_encoding&) _NOEXCEPT
@@ -23,42 +21,43 @@
// 4. operator==(const text_encoding&, const text_encoding&) returns false when comparingtext_encodings with different ids
// 5. operator==(const text_encoding&, const text_encoding&) for text_encodings with ids of "other" returns false if the names are not equal
-#include <cassert>
-#include <text_encoding>
-
-#include "test_macros.h"
#include "test_text_encoding.h"
using id = std::text_encoding::id;
int main() {
{ // 1
- auto te1 = std::text_encoding();
- auto te2 = std::text_encoding();
+ constexpr auto te1 = std::text_encoding();
+ constexpr auto te2 = std::text_encoding();
+ static_assert(te1 == te2);
ASSERT_NOEXCEPT(te1 == te2);
}
{ // 2
- auto te1 = std::text_encoding(id::UTF8);
- auto te2 = std::text_encoding(id::UTF8);
+ constexpr auto te1 = std::text_encoding(id::UTF8);
+ constexpr auto te2 = std::text_encoding(id::UTF8);
+ static_assert(te1 == te2);
assert(te1 == te2);
}
{ // 3
- auto other_te1 = std::text_encoding("foo");
- auto other_te2 = std::text_encoding("foo");
+ constexpr auto other_te1 = std::text_encoding("foo");
+ constexpr auto other_te2 = std::text_encoding("foo");
assert(other_te1 == other_te2);
+ static_assert((other_te1 == other_te2));
}
{ // 4
- auto te1 = std::text_encoding(id::UTF8);
- auto te2 = std::text_encoding(id::UTF16);
+ constexpr auto te1 = std::text_encoding(id::UTF8);
+ constexpr auto te2 = std::text_encoding(id::UTF16);
assert(!(te1 == te2));
+ static_assert(!(te1 == te2));
}
{ // 5
- auto other_te1 = std::text_encoding("foo");
- auto other_te2 = std::text_encoding("bar");
+ constexpr auto other_te1 = std::text_encoding("foo");
+ constexpr auto other_te2 = std::text_encoding("bar");
assert(!(other_te1 == other_te2));
+ static_assert(!(other_te1 == other_te2));
}
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp
index 77fb2779de809..1844c664531ef 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/aliases.pass.cpp
@@ -18,12 +18,6 @@
// 1. Verify that text_encoding::aliases_view satisfies ranges::forward_range, copyable, view,
// ranges::random_access_range and ranges::borrowed_range
-#include <concepts>
-#include <ranges>
-#include <text_encoding>
-
-#include "platform_support.h"
-#include "test_macros.h"
#include "test_text_encoding.h"
int main() {
@@ -32,4 +26,6 @@ int main() {
static_assert(std::ranges::view<std::text_encoding::aliases_view>);
static_assert(std::ranges::random_access_range<std::text_encoding::aliases_view>);
static_assert(std::ranges::borrowed_range<std::text_encoding::aliases_view>);
+ static_assert(std::same_as<std::ranges::range_value_t<std::text_encoding::aliases_view>, const char*>);
+ static_assert(std::same_as<std::ranges::range_reference_t<std::text_encoding::aliases_view>, const char*>);
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.nodiscard.verify.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.nodiscard.verify.cpp
new file mode 100644
index 0000000000000..961a82c98af47
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.nodiscard.verify.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// UNSUPPORTED: no-localization
+
+// class text_encoding
+
+// text_encoding text_encoding::environment();
+// text_encoding text_encoding::environment_is<>();
+
+// Concerns:
+// 1. Verify that std::text_encoding::environmnet(), std::text_encoding::environment_is<>() are marked nodiscard
+
+#include "test_text_encoding.h"
+
+int main() {
+ // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::text_encoding::environment();
+ // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
+ std::text_encoding::environment_is<std::text_encoding::id::unknown>();
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
index 58458e53e35fd..f3c4557efec0d 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/environment.pass.cpp
@@ -12,49 +12,51 @@
// REQUIRES: locale.en_US.UTF-8
// UNSUPPORTED: no-localization
-// UNSUPPORTED: windows
// class text_encoding
// text_encoding text_encoding::environment();
// Concerns:
-// 1. text_encoding::environment() returns the encoding for the environment's default locale, which should be the "C" locale for a C++ program.
+// 1. Depending on the environment text_encoding mib, verify that environment_is returns true for that mib.
// 2. text_encoding::environment() still returns the default locale encoding when the locale is set to "en_US.UTF-8".
-// 3. text_encoding::environment() is affected by changes to the "LANG" environment variable.
+// 3. text_encoding::environment() is affected by changes to the "LANG" environment variable, except for Windows.
// The current implementation of text_encoding::environment() while conformant,
// is unfortunately affected by changes to the "LANG" environment variable.
-#include <cassert>
-#include <clocale>
-#include <cstdlib>
-#include <string_view>
-#include <text_encoding>
-
-#include "platform_support.h"
-#include "test_macros.h"
#include "test_text_encoding.h"
using id = std::text_encoding::id;
int main() {
- auto default_te = std::text_encoding(id::ASCII);
-
- { // 1
-
- auto env_te = std::text_encoding::environment();
- assert(env_te == std::text_encoding::environment());
- assert(checkTextEncoding(env_te, default_te));
+ auto env_te = std::text_encoding::environment();
+ // 1
+ {
+ auto mib = env_te.mib();
+
+ if (mib == std::text_encoding::ASCII) {
+ assert(std::text_encoding::environment_is<std::text_encoding::ASCII>());
+ }
+ if (mib == std::text_encoding::UTF8) {
+ assert(std::text_encoding::environment_is<std::text_encoding::UTF8>());
+ }
+ if (mib == std::text_encoding::ISOLatin1) {
+ assert(std::text_encoding::environment_is<std::text_encoding::ISOLatin1>());
+ }
+ if (mib == std::text_encoding::windows1252) {
+ assert(std::text_encoding::environment_is<std::text_encoding::windows1252>());
+ }
}
{ // 2
std::setlocale(LC_ALL, LOCALE_en_US_UTF_8);
- auto env_te = std::text_encoding::environment();
+ auto env_te2 = std::text_encoding::environment();
- assert(checkTextEncoding(env_te, default_te));
+ assert(checkTextEncoding(env_te, env_te2));
}
+#if !defined(_WIN32)
{ // 3
setenv("LANG", LOCALE_en_US_UTF_8, 1);
@@ -67,6 +69,6 @@ int main() {
assert(std::text_encoding::environment_is<std::text_encoding::id::UTF8>());
}
-
+#endif
return 0;
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp
index df58d13bdab6b..7ca9e1178ea75 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/literal.pass.cpp
@@ -18,26 +18,15 @@
// Concerns:
// 1. text_encoding::literal() returns the proper encoding depending on the compiler, else unknown.
-#include <cassert>
-#include <string_view>
-#include <text_encoding>
-
-#include "test_macros.h"
#include "test_text_encoding.h"
int main() {
-#if __CHAR_BIT__ == 8
-
- {
- auto te = std::text_encoding::literal();
-# ifdef __GNUC_EXECUTION_CHARSET_NAME
- assert(std::string_view(te.name()) == std::string_view(__GNUC_EXECUTION_CHARSET_NAME));
-# elif defined(__clang_literal_encoding__)
- assert(std::string_view(te.name()) == std::string_view(__clang_literal_encoding__));
-# else
- assert(te.mib() = std::text_encoding::id::unknown);
-# endif
- }
-
-#endif // if __CHAR_BIT__ == 8
+ auto te = std::text_encoding::literal();
+#ifdef __GNUC_EXECUTION_CHARSET_NAME
+ assert(std::string_view(te.name()) == std::string_view(__GNUC_EXECUTION_CHARSET_NAME));
+#elif defined(__clang_literal_encoding__)
+ assert(std::string_view(te.name()) == std::string_view(__clang_literal_encoding__));
+#else
+ assert(te.mib() = std::text_encoding::id::unknown);
+#endif
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/nodiscard.verify.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/nodiscard.verify.cpp
index e5462d030d844..a8a2183df6b77 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/nodiscard.verify.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/nodiscard.verify.cpp
@@ -10,6 +10,7 @@
// <text_encoding>
// REQUIRES: std-at-least-c++26
+// UNSUPPORTED: no-localization
// class text_encoding
@@ -26,12 +27,8 @@ int main() {
te.name();
// expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
te.aliases();
- // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
- te.environment();
- // expected-warning at +1 {{ignoring return value of function declared with 'nodiscard' attribute}}
- te.environment_is<std::text_encoding::id::unknown>();
- // Clang does not emit a nodiscard warning for consteval functions with [[nodiscard]]: See #141536
+ // Clang does not emit a nodiscard warning for consteval functions with [[nodiscard]]: See issue #141536
// expected-warning at +1 {{expression result unused}}
std::text_encoding::literal();
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp
index 03a9f763ad9a8..06a609bb815f3 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/begin.pass.cpp
@@ -17,13 +17,6 @@
// 2. begin() of aliases_views of two text_encoding objects that represent the same ID but hold different names are the same.
// 3. begin() of aliases_views of two text_encoding objects that represent different IDs are different.
-#include <cassert>
-#include <cstdlib>
-#include <text_encoding>
-#include <ranges>
-
-#include "platform_support.h"
-#include "test_macros.h"
#include "test_text_encoding.h"
using id = std::text_encoding::id;
@@ -35,6 +28,7 @@ int main() {
auto view2 = te.aliases();
assert(std::ranges::begin(view1) == std::ranges::begin(view2));
+ assert(view1.begin() == view2.begin());
}
{
@@ -44,6 +38,7 @@ int main() {
auto view1 = te1.aliases();
auto view2 = te2.aliases();
+ assert(view1.begin() == view2.begin());
assert(std::ranges::begin(view1) == std::ranges::begin(view2));
}
@@ -54,6 +49,7 @@ int main() {
auto view1 = te1.aliases();
auto view2 = te2.aliases();
+ assert(!(view1.begin() == view2.begin()));
assert(!(std::ranges::begin(view1) == std::ranges::begin(view2)));
}
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp
index f645dfa7897d4..c9db293786992 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/empty.pass.cpp
@@ -9,6 +9,7 @@
// <text_encoding>
// REQUIRES: std-at-least-c++26
+// ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=9000000
// struct text_encoding::aliases_view
@@ -17,42 +18,55 @@
// 2. An alias_view of a text_encoding object for "unknown" is empty
// 3. An alias_view of a text_encoding object for a known encoding e.g. "UTF-8" is not empty
-#include <cassert>
-#include <cstdlib>
-#include <ranges>
-#include <text_encoding>
-
-#include "platform_support.h"
-#include "test_macros.h"
#include "test_text_encoding.h"
using id = std::text_encoding::id;
-int main() {
- {
- auto te = std::text_encoding(id::other);
- auto empty_range = te.aliases();
+constexpr bool test_other() {
+ auto te1 = std::text_encoding(id::other);
+ auto empty_range = te1.aliases();
+ assert(std::ranges::empty(empty_range) && empty_range.empty() && !bool(empty_range));
- assert(std::ranges::empty(empty_range));
- assert(empty_range.empty());
- assert(!bool(empty_range));
+ for (auto& other_name : other_names) {
+ auto te_other = std::text_encoding(other_name);
+ auto empty_range_other = te_other.aliases();
+ assert(std::ranges::empty(empty_range_other) && empty_range_other.empty() && !bool(empty_range_other));
}
- {
- auto te = std::text_encoding(id::unknown);
- auto empty_range = te.aliases();
+ return true;
+}
- assert(std::ranges::empty(empty_range));
- assert(empty_range.empty());
- assert(!bool(empty_range));
- }
+constexpr bool test_unknown() {
+ auto te = std::text_encoding(id::unknown);
+ auto empty_range = te.aliases();
+ return std::ranges::empty(empty_range) && empty_range.empty() && !bool(empty_range);
+}
- {
- auto te = std::text_encoding(id::UTF8);
+constexpr bool test_primary_encodings() {
+ for (auto& data : unique_encoding_data) {
+ auto te = std::text_encoding(id(data.mib));
auto range = te.aliases();
assert(!std::ranges::empty(range));
assert(!range.empty());
assert(bool(range));
}
+ return true;
+}
+
+int main() {
+ {
+ static_assert(test_other());
+ assert(test_other());
+ }
+
+ {
+ static_assert(test_unknown());
+ assert(test_unknown());
+ }
+
+ {
+ static_assert(test_primary_encodings());
+ assert(test_primary_encodings());
+ }
}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/end.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/end.pass.cpp
new file mode 100644
index 0000000000000..b57c7239787a1
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/end.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// struct text_encoding::aliases_view
+
+// Concerns:
+// 1. begin() of an aliases_view() of "other" is equal to end()
+// 2. That pushing an iterator beyond its range will result in it comparing equal to its end()
+
+#include "test_text_encoding.h"
+
+int main() {
+ auto te1 = std::text_encoding("US-ASCII");
+ auto te2 = std::text_encoding("UTF_8");
+ auto other_te = std::text_encoding(std::text_encoding::other);
+ auto a_1 = te1.aliases(), a_2 = te2.aliases();
+ auto a_other = other_te.aliases();
+
+ auto iter1 = a_1.begin(), iter2 = a_2.begin();
+ // 1.
+ assert(a_other.begin() == a_other.end());
+
+ // 2.
+ assert((iter1 + 1000) == std::ranges::end(a_1));
+ assert((iter1 + 1000) == a_1.end());
+ assert((iter2 + 1000) == std::ranges::end(a_2));
+ assert((iter2 + 1000) == a_2.end());
+}
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp
index bc65891c08f09..d0544b6d7971d 100644
--- a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/front.pass.cpp
@@ -17,12 +17,6 @@
// 2. An aliases_views of two text_encoding objects that represent the same ID but hold different names return the same front()
// 3. An aliases_views of two text_encoding objects that represent different IDs return different front()
-#include <cassert>
-#include <cstdlib>
-#include <text_encoding>
-
-#include "platform_support.h"
-#include "test_macros.h"
#include "test_text_encoding.h"
using id = std::text_encoding::id;
@@ -38,7 +32,7 @@ int main() {
}
{
- auto te1 = std::text_encoding("ANSI_X3.4-1968");
+ auto te1 = std::text_encoding("US-ASCII");
auto te2 = std::text_encoding("ANSI_X3.4-1986");
auto view1 = te1.aliases();
diff --git a/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/iterator.pass.cpp b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/iterator.pass.cpp
new file mode 100644
index 0000000000000..38e4bd83cff72
--- /dev/null
+++ b/libcxx/test/std/utilities/text_encoding/text_encoding.members/text_encoding.aliases_view/iterator.pass.cpp
@@ -0,0 +1,101 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <text_encoding>
+
+// REQUIRES: std-at-least-c++26
+
+// struct text_encoding::aliases_view
+
+#include "test_text_encoding.h"
+
+constexpr bool iter_test() {
+ constexpr int num_ascii_aliases = 11;
+
+ constexpr auto te = std::text_encoding("US-ASCII"); // 11 aliases
+ constexpr auto te2 = std::text_encoding("ANSI_X3.4-1968");
+
+ constexpr auto aliases = te.aliases(), aliases2 = te2.aliases();
+ auto begin_ascii = aliases.begin(), begin_ascii2 = aliases2.begin();
+ auto end_ascii = aliases.end(), end_ascii2 = aliases2.end();
+ auto iter_ascii = aliases.begin(), iter_ascii2 = aliases2.begin();
+
+ assert(*iter_ascii == *begin_ascii);
+ assert(*iter_ascii == *begin_ascii2);
+ assert(*iter_ascii2 == *begin_ascii);
+ assert(*iter_ascii2 == *begin_ascii2);
+
+ assert(*iter_ascii == iter_ascii[0]);
+ assert(*iter_ascii == iter_ascii2[0]);
+ assert(iter_ascii[0] == iter_ascii2[0]);
+ assert(iter_ascii[0] == *begin_ascii);
+ assert(iter_ascii[0] == *begin_ascii2);
+ assert(iter_ascii2[0] == *begin_ascii);
+ assert(iter_ascii2[0] == *begin_ascii2);
+ assert(iter_ascii[1] == begin_ascii[1]);
+ assert(iter_ascii[1] == begin_ascii2[1]);
+ assert(begin_ascii[1] == begin_ascii2[1]);
+
+ --iter_ascii;
+ ++iter_ascii;
+ assert(iter_ascii == begin_ascii);
+ ++iter_ascii2;
+ assert(iter_ascii != iter_ascii2);
+ assert(iter_ascii2 != begin_ascii2);
+ iter_ascii2--;
+ assert(iter_ascii == iter_ascii2);
+ assert(iter_ascii2 == begin_ascii2);
+
+ auto iter3 = iter_ascii++;
+ assert(iter3 == begin_ascii);
+ assert(iter_ascii != begin_ascii);
+ iter3 = iter_ascii--;
+ assert(iter3 != begin_ascii);
+ assert(iter_ascii == begin_ascii);
+
+ iter_ascii++ ++; // Increments prvalue returned by operator++(int) instead of iter.
+ assert(iter_ascii == iter3);
+ iter_ascii-- --; // Decrements prvalue returned by operator++(int) instead of iter.
+ assert(iter_ascii == begin_ascii);
+
+ const auto d = std::ranges::distance(aliases);
+ iter_ascii += d;
+ iter_ascii2 += d;
+ assert(iter_ascii == end_ascii);
+ assert(iter_ascii == end_ascii2);
+ assert(iter_ascii2 == end_ascii);
+ assert(iter_ascii2 == end_ascii2);
+
+ assert((iter_ascii - begin_ascii) == d);
+ assert((begin_ascii + num_ascii_aliases) == iter_ascii);
+ assert((num_ascii_aliases + begin_ascii) == iter_ascii);
+ assert(iter_ascii[-1] == begin_ascii[num_ascii_aliases - 1]);
+
+ iter_ascii -= d;
+ iter_ascii2 -= d;
+ assert(iter_ascii == begin_ascii);
+ assert(iter_ascii == begin_ascii2);
+
+ assert(iter_ascii2 == begin_ascii);
+ assert(iter_ascii2 == begin_ascii2);
+
+ assert(*(iter_ascii + 1) == iter_ascii[1]);
+ assert((1 + iter_ascii - 1) == begin_ascii);
+ assert((-1 + (iter_ascii - -2) + -1) == begin_ascii);
+
+ std::ranges::iterator_t<std::text_encoding::aliases_view> singular{};
+ assert((singular + 0) == singular);
+ assert((singular - 0) == singular);
+
+ return true;
+}
+
+int main() {
+ static_assert(iter_test());
+ assert(iter_test());
+}
diff --git a/libcxx/test/support/test_text_encoding.h b/libcxx/test/support/test_text_encoding.h
index 3d41cb9489ef8..3969674e3b434 100644
--- a/libcxx/test/support/test_text_encoding.h
+++ b/libcxx/test/support/test_text_encoding.h
@@ -9,1181 +9,1193 @@
#ifndef SUPPORT_TEST_TEXT_ENCODING_H
#define SUPPORT_TEST_TEXT_ENCODING_H
-#include <array>
-#include <cstdint>
+#include <algorithm>
+#include <cassert>
+#include <clocale>
+#include <concepts>
+#include <cstdio>
+#include <cstdlib>
#include <iostream>
#include <print>
+#include <ranges>
+#include <string_view>
+#include <text_encoding>
+#include <type_traits>
+#include "platform_support.h"
#include "test_macros.h"
-struct encoding_pair {
- int_least32_t mib;
+struct encoding_data {
const char* name;
+ int mib;
+ int size;
};
-constexpr std::array<const encoding_pair, 882> all_encoding_data{{
+constexpr encoding_data all_encoding_data[]{
+ {"US-ASCII", 3, 8},
+ {"iso-ir-6", 3, 8},
+ {"ANSI_X3.4-1968", 3, 14},
+ {"ANSI_X3.4-1986", 3, 14},
+ {"ISO_646.irv:1991", 3, 16},
+ {"ISO646-US", 3, 9},
+ {"us", 3, 2},
+ {"IBM367", 3, 6},
+ {"cp367", 3, 5},
+ {"csASCII", 3, 7},
+ {"ASCII", 3, 5},
+ {"ISO_8859-1:1987", 4, 15},
+ {"iso-ir-100", 4, 10},
+ {"ISO_8859-1", 4, 10},
+ {"ISO-8859-1", 4, 10},
+ {"latin1", 4, 6},
+ {"l1", 4, 2},
+ {"IBM819", 4, 6},
+ {"CP819", 4, 5},
+ {"csISOLatin1", 4, 11},
+ {"ISO_8859-2:1987", 5, 15},
+ {"iso-ir-101", 5, 10},
+ {"ISO_8859-2", 5, 10},
+ {"ISO-8859-2", 5, 10},
+ {"latin2", 5, 6},
+ {"l2", 5, 2},
+ {"csISOLatin2", 5, 11},
+ {"ISO_8859-3:1988", 6, 15},
+ {"iso-ir-109", 6, 10},
+ {"ISO_8859-3", 6, 10},
+ {"ISO-8859-3", 6, 10},
+ {"latin3", 6, 6},
+ {"l3", 6, 2},
+ {"csISOLatin3", 6, 11},
+ {"ISO_8859-4:1988", 7, 15},
+ {"iso-ir-110", 7, 10},
+ {"ISO_8859-4", 7, 10},
+ {"ISO-8859-4", 7, 10},
+ {"latin4", 7, 6},
+ {"l4", 7, 2},
+ {"csISOLatin4", 7, 11},
+ {"ISO_8859-5:1988", 8, 15},
+ {"iso-ir-144", 8, 10},
+ {"ISO_8859-5", 8, 10},
+ {"ISO-8859-5", 8, 10},
+ {"cyrillic", 8, 8},
+ {"csISOLatinCyrillic", 8, 18},
+ {"ISO_8859-6:1987", 9, 15},
+ {"iso-ir-127", 9, 10},
+ {"ISO_8859-6", 9, 10},
+ {"ISO-8859-6", 9, 10},
+ {"ECMA-114", 9, 8},
+ {"ASMO-708", 9, 8},
+ {"arabic", 9, 6},
+ {"csISOLatinArabic", 9, 16},
+ {"ISO_8859-7:1987", 10, 15},
+ {"iso-ir-126", 10, 10},
+ {"ISO_8859-7", 10, 10},
+ {"ISO-8859-7", 10, 10},
+ {"ELOT_928", 10, 8},
+ {"ECMA-118", 10, 8},
+ {"greek", 10, 5},
+ {"greek8", 10, 6},
+ {"csISOLatinGreek", 10, 15},
+ {"ISO_8859-8:1988", 11, 15},
+ {"iso-ir-138", 11, 10},
+ {"ISO_8859-8", 11, 10},
+ {"ISO-8859-8", 11, 10},
+ {"hebrew", 11, 6},
+ {"csISOLatinHebrew", 11, 16},
+ {"ISO_8859-9:1989", 12, 15},
+ {"iso-ir-148", 12, 10},
+ {"ISO_8859-9", 12, 10},
+ {"ISO-8859-9", 12, 10},
+ {"latin5", 12, 6},
+ {"l5", 12, 2},
+ {"csISOLatin5", 12, 11},
+ {"ISO-8859-10", 13, 11},
+ {"iso-ir-157", 13, 10},
+ {"l6", 13, 2},
+ {"ISO_8859-10:1992", 13, 16},
+ {"csISOLatin6", 13, 11},
+ {"latin6", 13, 6},
+ {"ISO_6937-2-add", 14, 14},
+ {"iso-ir-142", 14, 10},
+ {"csISOTextComm", 14, 13},
+ {"JIS_X0201", 15, 9},
+ {"X0201", 15, 5},
+ {"csHalfWidthKatakana", 15, 19},
+ {"JIS_Encoding", 16, 12},
+ {"csJISEncoding", 16, 13},
+ {"Shift_JIS", 17, 9},
+ {"MS_Kanji", 17, 8},
+ {"csShiftJIS", 17, 10},
+ {"Extended_UNIX_Code_Packed_Format_for_Japanese", 18, 45},
+ {"csEUCPkdFmtJapanese", 18, 19},
+ {"EUC-JP", 18, 6},
+ {"Extended_UNIX_Code_Fixed_Width_for_Japanese", 19, 43},
+ {"csEUCFixWidJapanese", 19, 19},
+ {"BS_4730", 20, 7},
+ {"iso-ir-4", 20, 8},
+ {"ISO646-GB", 20, 9},
+ {"gb", 20, 2},
+ {"uk", 20, 2},
+ {"csISO4UnitedKingdom", 20, 19},
+ {"SEN_850200_C", 21, 12},
+ {"iso-ir-11", 21, 9},
+ {"ISO646-SE2", 21, 10},
+ {"se2", 21, 3},
+ {"csISO11SwedishForNames", 21, 22},
+ {"IT", 22, 2},
+ {"iso-ir-15", 22, 9},
+ {"ISO646-IT", 22, 9},
+ {"csISO15Italian", 22, 14},
+ {"ES", 23, 2},
+ {"iso-ir-17", 23, 9},
+ {"ISO646-ES", 23, 9},
+ {"csISO17Spanish", 23, 14},
+ {"DIN_66003", 24, 9},
+ {"iso-ir-21", 24, 9},
+ {"de", 24, 2},
+ {"ISO646-DE", 24, 9},
+ {"csISO21German", 24, 13},
+ {"NS_4551-1", 25, 9},
+ {"iso-ir-60", 25, 9},
+ {"ISO646-NO", 25, 9},
+ {"no", 25, 2},
+ {"csISO60DanishNorwegian", 25, 22},
+ {"csISO60Norwegian1", 25, 17},
+ {"NF_Z_62-010", 26, 11},
+ {"iso-ir-69", 26, 9},
+ {"ISO646-FR", 26, 9},
+ {"fr", 26, 2},
+ {"csISO69French", 26, 13},
+ {"ISO-10646-UTF-1", 27, 15},
+ {"csISO10646UTF1", 27, 14},
+ {"ISO_646.basic:1983", 28, 18},
+ {"ref", 28, 3},
+ {"csISO646basic1983", 28, 17},
+ {"INVARIANT", 29, 9},
+ {"csINVARIANT", 29, 11},
+ {"ISO_646.irv:1983", 30, 16},
+ {"iso-ir-2", 30, 8},
+ {"irv", 30, 3},
+ {"csISO2IntlRefVersion", 30, 20},
+ {"NATS-SEFI", 31, 9},
+ {"iso-ir-8-1", 31, 10},
+ {"csNATSSEFI", 31, 10},
+ {"NATS-SEFI-ADD", 32, 13},
+ {"iso-ir-8-2", 32, 10},
+ {"csNATSSEFIADD", 32, 13},
+ {"SEN_850200_B", 35, 12},
+ {"iso-ir-10", 35, 9},
+ {"FI", 35, 2},
+ {"ISO646-FI", 35, 9},
+ {"ISO646-SE", 35, 9},
+ {"se", 35, 2},
+ {"csISO10Swedish", 35, 14},
+ {"KS_C_5601-1987", 36, 14},
+ {"iso-ir-149", 36, 10},
+ {"KS_C_5601-1989", 36, 14},
+ {"KSC_5601", 36, 8},
+ {"korean", 36, 6},
+ {"csKSC56011987", 36, 13},
+ {"ISO-2022-KR", 37, 11},
+ {"csISO2022KR", 37, 11},
+ {"EUC-KR", 38, 6},
+ {"csEUCKR", 38, 7},
+ {"ISO-2022-JP", 39, 11},
+ {"csISO2022JP", 39, 11},
+ {"ISO-2022-JP-2", 40, 13},
+ {"csISO2022JP2", 40, 12},
+ {"JIS_C6220-1969-jp", 41, 17},
+ {"JIS_C6220-1969", 41, 14},
+ {"iso-ir-13", 41, 9},
+ {"katakana", 41, 8},
+ {"x0201-7", 41, 7},
+ {"csISO13JISC6220jp", 41, 17},
+ {"JIS_C6220-1969-ro", 42, 17},
+ {"iso-ir-14", 42, 9},
+ {"jp", 42, 2},
+ {"ISO646-JP", 42, 9},
+ {"csISO14JISC6220ro", 42, 17},
+ {"PT", 43, 2},
+ {"iso-ir-16", 43, 9},
+ {"ISO646-PT", 43, 9},
+ {"csISO16Portuguese", 43, 17},
+ {"greek7-old", 44, 10},
+ {"iso-ir-18", 44, 9},
+ {"csISO18Greek7Old", 44, 16},
+ {"latin-greek", 45, 11},
+ {"iso-ir-19", 45, 9},
+ {"csISO19LatinGreek", 45, 17},
+ {"NF_Z_62-010_(1973)", 46, 18},
+ {"iso-ir-25", 46, 9},
+ {"ISO646-FR1", 46, 10},
+ {"csISO25French", 46, 13},
+ {"Latin-greek-1", 47, 13},
+ {"iso-ir-27", 47, 9},
+ {"csISO27LatinGreek1", 47, 18},
+ {"ISO_5427", 48, 8},
+ {"iso-ir-37", 48, 9},
+ {"csISO5427Cyrillic", 48, 17},
+ {"JIS_C6226-1978", 49, 14},
+ {"iso-ir-42", 49, 9},
+ {"csISO42JISC62261978", 49, 19},
+ {"BS_viewdata", 50, 11},
+ {"iso-ir-47", 50, 9},
+ {"csISO47BSViewdata", 50, 17},
+ {"INIS", 51, 4},
+ {"iso-ir-49", 51, 9},
+ {"csISO49INIS", 51, 11},
+ {"INIS-8", 52, 6},
+ {"iso-ir-50", 52, 9},
+ {"csISO50INIS8", 52, 12},
+ {"INIS-cyrillic", 53, 13},
+ {"iso-ir-51", 53, 9},
+ {"csISO51INISCyrillic", 53, 19},
+ {"ISO_5427:1981", 54, 13},
+ {"iso-ir-54", 54, 9},
+ {"ISO5427Cyrillic1981", 54, 19},
+ {"csISO54271981", 54, 13},
+ {"ISO_5428:1980", 55, 13},
+ {"iso-ir-55", 55, 9},
+ {"csISO5428Greek", 55, 14},
+ {"GB_1988-80", 56, 10},
+ {"iso-ir-57", 56, 9},
+ {"cn", 56, 2},
+ {"ISO646-CN", 56, 9},
+ {"csISO57GB1988", 56, 13},
+ {"GB_2312-80", 57, 10},
+ {"iso-ir-58", 57, 9},
+ {"chinese", 57, 7},
+ {"csISO58GB231280", 57, 15},
+ {"NS_4551-2", 58, 9},
+ {"ISO646-NO2", 58, 10},
+ {"iso-ir-61", 58, 9},
+ {"no2", 58, 3},
+ {"csISO61Norwegian2", 58, 17},
+ {"videotex-suppl", 59, 14},
+ {"iso-ir-70", 59, 9},
+ {"csISO70VideotexSupp1", 59, 20},
+ {"PT2", 60, 3},
+ {"iso-ir-84", 60, 9},
+ {"ISO646-PT2", 60, 10},
+ {"csISO84Portuguese2", 60, 18},
+ {"ES2", 61, 3},
+ {"iso-ir-85", 61, 9},
+ {"ISO646-ES2", 61, 10},
+ {"csISO85Spanish2", 61, 15},
+ {"MSZ_7795.3", 62, 10},
+ {"iso-ir-86", 62, 9},
+ {"ISO646-HU", 62, 9},
+ {"hu", 62, 2},
+ {"csISO86Hungarian", 62, 16},
+ {"JIS_C6226-1983", 63, 14},
+ {"iso-ir-87", 63, 9},
+ {"x0208", 63, 5},
+ {"JIS_X0208-1983", 63, 14},
+ {"csISO87JISX0208", 63, 15},
+ {"greek7", 64, 6},
+ {"iso-ir-88", 64, 9},
+ {"csISO88Greek7", 64, 13},
+ {"ASMO_449", 65, 8},
+ {"ISO_9036", 65, 8},
+ {"arabic7", 65, 7},
+ {"iso-ir-89", 65, 9},
+ {"csISO89ASMO449", 65, 14},
+ {"iso-ir-90", 66, 9},
+ {"csISO90", 66, 7},
+ {"JIS_C6229-1984-a", 67, 16},
+ {"iso-ir-91", 67, 9},
+ {"jp-ocr-a", 67, 8},
+ {"csISO91JISC62291984a", 67, 20},
+ {"JIS_C6229-1984-b", 68, 16},
+ {"iso-ir-92", 68, 9},
+ {"ISO646-JP-OCR-B", 68, 15},
+ {"jp-ocr-b", 68, 8},
+ {"csISO92JISC62991984b", 68, 20},
+ {"JIS_C6229-1984-b-add", 69, 20},
+ {"iso-ir-93", 69, 9},
+ {"jp-ocr-b-add", 69, 12},
+ {"csISO93JIS62291984badd", 69, 22},
+ {"JIS_C6229-1984-hand", 70, 19},
+ {"iso-ir-94", 70, 9},
+ {"jp-ocr-hand", 70, 11},
+ {"csISO94JIS62291984hand", 70, 22},
+ {"JIS_C6229-1984-hand-add", 71, 23},
+ {"iso-ir-95", 71, 9},
+ {"jp-ocr-hand-add", 71, 15},
+ {"csISO95JIS62291984handadd", 71, 25},
+ {"JIS_C6229-1984-kana", 72, 19},
+ {"iso-ir-96", 72, 9},
+ {"csISO96JISC62291984kana", 72, 23},
+ {"ISO_2033-1983", 73, 13},
+ {"iso-ir-98", 73, 9},
+ {"e13b", 73, 4},
+ {"csISO2033", 73, 9},
+ {"ANSI_X3.110-1983", 74, 16},
+ {"iso-ir-99", 74, 9},
+ {"CSA_T500-1983", 74, 13},
+ {"NAPLPS", 74, 6},
+ {"csISO99NAPLPS", 74, 13},
+ {"T.61-7bit", 75, 9},
+ {"iso-ir-102", 75, 10},
+ {"csISO102T617bit", 75, 15},
+ {"T.61-8bit", 76, 9},
+ {"T.61", 76, 4},
+ {"iso-ir-103", 76, 10},
+ {"csISO103T618bit", 76, 15},
+ {"ECMA-cyrillic", 77, 13},
+ {"iso-ir-111", 77, 10},
+ {"KOI8-E", 77, 6},
+ {"csISO111ECMACyrillic", 77, 20},
+ {"CSA_Z243.4-1985-1", 78, 17},
+ {"iso-ir-121", 78, 10},
+ {"ISO646-CA", 78, 9},
+ {"csa7-1", 78, 6},
+ {"csa71", 78, 5},
+ {"ca", 78, 2},
+ {"csISO121Canadian1", 78, 17},
+ {"CSA_Z243.4-1985-2", 79, 17},
+ {"iso-ir-122", 79, 10},
+ {"ISO646-CA2", 79, 10},
+ {"csa7-2", 79, 6},
+ {"csa72", 79, 5},
+ {"csISO122Canadian2", 79, 17},
+ {"CSA_Z243.4-1985-gr", 80, 18},
+ {"iso-ir-123", 80, 10},
+ {"csISO123CSAZ24341985gr", 80, 22},
+ {"ISO_8859-6-E", 81, 12},
+ {"csISO88596E", 81, 11},
+ {"ISO-8859-6-E", 81, 12},
+ {"ISO_8859-6-I", 82, 12},
+ {"csISO88596I", 82, 11},
+ {"ISO-8859-6-I", 82, 12},
+ {"T.101-G2", 83, 8},
+ {"iso-ir-128", 83, 10},
+ {"csISO128T101G2", 83, 14},
+ {"ISO_8859-8-E", 84, 12},
+ {"csISO88598E", 84, 11},
+ {"ISO-8859-8-E", 84, 12},
+ {"ISO_8859-8-I", 85, 12},
+ {"csISO88598I", 85, 11},
+ {"ISO-8859-8-I", 85, 12},
+ {"CSN_369103", 86, 10},
+ {"iso-ir-139", 86, 10},
+ {"csISO139CSN369103", 86, 17},
+ {"JUS_I.B1.002", 87, 12},
+ {"iso-ir-141", 87, 10},
+ {"ISO646-YU", 87, 9},
+ {"js", 87, 2},
+ {"yu", 87, 2},
+ {"csISO141JUSIB1002", 87, 17},
+ {"IEC_P27-1", 88, 9},
+ {"iso-ir-143", 88, 10},
+ {"csISO143IECP271", 88, 15},
+ {"JUS_I.B1.003-serb", 89, 17},
+ {"iso-ir-146", 89, 10},
+ {"serbian", 89, 7},
+ {"csISO146Serbian", 89, 15},
+ {"JUS_I.B1.003-mac", 90, 16},
+ {"macedonian", 90, 10},
+ {"iso-ir-147", 90, 10},
+ {"csISO147Macedonian", 90, 18},
+ {"greek-ccitt", 91, 11},
+ {"iso-ir-150", 91, 10},
+ {"csISO150", 91, 8},
+ {"csISO150GreekCCITT", 91, 18},
+ {"NC_NC00-10:81", 92, 13},
+ {"cuba", 92, 4},
+ {"iso-ir-151", 92, 10},
+ {"ISO646-CU", 92, 9},
+ {"csISO151Cuba", 92, 12},
+ {"ISO_6937-2-25", 93, 13},
+ {"iso-ir-152", 93, 10},
+ {"csISO6937Add", 93, 12},
+ {"GOST_19768-74", 94, 13},
+ {"ST_SEV_358-88", 94, 13},
+ {"iso-ir-153", 94, 10},
+ {"csISO153GOST1976874", 94, 19},
+ {"ISO_8859-supp", 95, 13},
+ {"iso-ir-154", 95, 10},
+ {"latin1-2-5", 95, 10},
+ {"csISO8859Supp", 95, 13},
+ {"ISO_10367-box", 96, 13},
+ {"iso-ir-155", 96, 10},
+ {"csISO10367Box", 96, 13},
+ {"latin-lap", 97, 9},
+ {"lap", 97, 3},
+ {"iso-ir-158", 97, 10},
+ {"csISO158Lap", 97, 11},
+ {"JIS_X0212-1990", 98, 14},
+ {"x0212", 98, 5},
+ {"iso-ir-159", 98, 10},
+ {"csISO159JISX02121990", 98, 20},
+ {"DS_2089", 99, 7},
+ {"DS2089", 99, 6},
+ {"ISO646-DK", 99, 9},
+ {"dk", 99, 2},
+ {"csISO646Danish", 99, 14},
+ {"us-dk", 100, 5},
+ {"csUSDK", 100, 6},
+ {"dk-us", 101, 5},
+ {"csDKUS", 101, 6},
+ {"KSC5636", 102, 7},
+ {"ISO646-KR", 102, 9},
+ {"csKSC5636", 102, 9},
+ {"UNICODE-1-1-UTF-7", 103, 17},
+ {"csUnicode11UTF7", 103, 15},
+ {"ISO-2022-CN", 104, 11},
+ {"csISO2022CN", 104, 11},
+ {"ISO-2022-CN-EXT", 105, 15},
+ {"csISO2022CNEXT", 105, 14},
+ {"UTF-8", 106, 5},
+ {"csUTF8", 106, 6},
+ {"ISO-8859-13", 109, 11},
+ {"csISO885913", 109, 11},
+ {"ISO-8859-14", 110, 11},
+ {"iso-ir-199", 110, 10},
+ {"ISO_8859-14:1998", 110, 16},
+ {"ISO_8859-14", 110, 11},
+ {"latin8", 110, 6},
+ {"iso-celtic", 110, 10},
+ {"l8", 110, 2},
+ {"csISO885914", 110, 11},
+ {"ISO-8859-15", 111, 11},
+ {"ISO_8859-15", 111, 11},
+ {"Latin-9", 111, 7},
+ {"csISO885915", 111, 11},
+ {"ISO-8859-16", 112, 11},
+ {"iso-ir-226", 112, 10},
+ {"ISO_8859-16:2001", 112, 16},
+ {"ISO_8859-16", 112, 11},
+ {"latin10", 112, 7},
+ {"l10", 112, 3},
+ {"csISO885916", 112, 11},
+ {"GBK", 113, 3},
+ {"CP936", 113, 5},
+ {"MS936", 113, 5},
+ {"windows-936", 113, 11},
+ {"csGBK", 113, 5},
+ {"GB18030", 114, 7},
+ {"csGB18030", 114, 9},
+ {"OSD_EBCDIC_DF04_15", 115, 18},
+ {"csOSDEBCDICDF0415", 115, 17},
+ {"OSD_EBCDIC_DF03_IRV", 116, 19},
+ {"csOSDEBCDICDF03IRV", 116, 18},
+ {"OSD_EBCDIC_DF04_1", 117, 17},
+ {"csOSDEBCDICDF041", 117, 16},
+ {"ISO-11548-1", 118, 11},
+ {"ISO_11548-1", 118, 11},
+ {"ISO_TR_11548-1", 118, 14},
+ {"csISO115481", 118, 11},
+ {"KZ-1048", 119, 7},
+ {"STRK1048-2002", 119, 13},
+ {"RK1048", 119, 6},
+ {"csKZ1048", 119, 8},
+ {"ISO-10646-UCS-2", 1000, 15},
+ {"csUnicode", 1000, 9},
+ {"ISO-10646-UCS-4", 1001, 15},
+ {"csUCS4", 1001, 6},
+ {"ISO-10646-UCS-Basic", 1002, 19},
+ {"csUnicodeASCII", 1002, 14},
+ {"ISO-10646-Unicode-Latin1", 1003, 24},
+ {"csUnicodeLatin1", 1003, 15},
+ {"ISO-10646", 1003, 9},
+ {"ISO-10646-J-1", 1004, 13},
+ {"csUnicodeJapanese", 1004, 17},
+ {"ISO-Unicode-IBM-1261", 1005, 20},
+ {"csUnicodeIBM1261", 1005, 16},
+ {"ISO-Unicode-IBM-1268", 1006, 20},
+ {"csUnicodeIBM1268", 1006, 16},
+ {"ISO-Unicode-IBM-1276", 1007, 20},
+ {"csUnicodeIBM1276", 1007, 16},
+ {"ISO-Unicode-IBM-1264", 1008, 20},
+ {"csUnicodeIBM1264", 1008, 16},
+ {"ISO-Unicode-IBM-1265", 1009, 20},
+ {"csUnicodeIBM1265", 1009, 16},
+ {"UNICODE-1-1", 1010, 11},
+ {"csUnicode11", 1010, 11},
+ {"SCSU", 1011, 4},
+ {"csSCSU", 1011, 6},
+ {"UTF-7", 1012, 5},
+ {"csUTF7", 1012, 6},
+ {"UTF-16BE", 1013, 8},
+ {"csUTF16BE", 1013, 9},
+ {"UTF-16LE", 1014, 8},
+ {"csUTF16LE", 1014, 9},
+ {"UTF-16", 1015, 6},
+ {"csUTF16", 1015, 7},
+ {"CESU-8", 1016, 6},
+ {"csCESU8", 1016, 7},
+ {"csCESU-8", 1016, 8},
+ {"UTF-32", 1017, 6},
+ {"csUTF32", 1017, 7},
+ {"UTF-32BE", 1018, 8},
+ {"csUTF32BE", 1018, 9},
+ {"UTF-32LE", 1019, 8},
+ {"csUTF32LE", 1019, 9},
+ {"BOCU-1", 1020, 6},
+ {"csBOCU1", 1020, 7},
+ {"csBOCU-1", 1020, 8},
+ {"UTF-7-IMAP", 1021, 10},
+ {"csUTF7IMAP", 1021, 10},
+ {"ISO-8859-1-Windows-3.0-Latin-1", 2000, 30},
+ {"csWindows30Latin1", 2000, 17},
+ {"ISO-8859-1-Windows-3.1-Latin-1", 2001, 30},
+ {"csWindows31Latin1", 2001, 17},
+ {"ISO-8859-2-Windows-Latin-2", 2002, 26},
+ {"csWindows31Latin2", 2002, 17},
+ {"ISO-8859-9-Windows-Latin-5", 2003, 26},
+ {"csWindows31Latin5", 2003, 17},
+ {"hp-roman8", 2004, 9},
+ {"roman8", 2004, 6},
+ {"r8", 2004, 2},
+ {"csHPRoman8", 2004, 10},
+ {"Adobe-Standard-Encoding", 2005, 23},
+ {"csAdobeStandardEncoding", 2005, 23},
+ {"Ventura-US", 2006, 10},
+ {"csVenturaUS", 2006, 11},
+ {"Ventura-International", 2007, 21},
+ {"csVenturaInternational", 2007, 22},
+ {"DEC-MCS", 2008, 7},
+ {"dec", 2008, 3},
+ {"csDECMCS", 2008, 8},
+ {"IBM850", 2009, 6},
+ {"cp850", 2009, 5},
+ {"850", 2009, 3},
+ {"csPC850Multilingual", 2009, 19},
+ {"IBM852", 2010, 6},
+ {"cp852", 2010, 5},
+ {"852", 2010, 3},
+ {"csPCp852", 2010, 8},
+ {"IBM437", 2011, 6},
+ {"cp437", 2011, 5},
+ {"437", 2011, 3},
+ {"csPC8CodePage437", 2011, 16},
+ {"PC8-Danish-Norwegian", 2012, 20},
+ {"csPC8DanishNorwegian", 2012, 20},
+ {"IBM862", 2013, 6},
+ {"cp862", 2013, 5},
+ {"862", 2013, 3},
+ {"csPC862LatinHebrew", 2013, 18},
+ {"PC8-Turkish", 2014, 11},
+ {"csPC8Turkish", 2014, 12},
+ {"IBM-Symbols", 2015, 11},
+ {"csIBMSymbols", 2015, 12},
+ {"IBM-Thai", 2016, 8},
+ {"csIBMThai", 2016, 9},
+ {"HP-Legal", 2017, 8},
+ {"csHPLegal", 2017, 9},
+ {"HP-Pi-font", 2018, 10},
+ {"csHPPiFont", 2018, 10},
+ {"HP-Math8", 2019, 8},
+ {"csHPMath8", 2019, 9},
+ {"Adobe-Symbol-Encoding", 2020, 21},
+ {"csHPPSMath", 2020, 10},
+ {"HP-DeskTop", 2021, 10},
+ {"csHPDesktop", 2021, 11},
+ {"Ventura-Math", 2022, 12},
+ {"csVenturaMath", 2022, 13},
+ {"Microsoft-Publishing", 2023, 20},
+ {"csMicrosoftPublishing", 2023, 21},
+ {"Windows-31J", 2024, 11},
+ {"csWindows31J", 2024, 12},
+ {"GB2312", 2025, 6},
+ {"csGB2312", 2025, 8},
+ {"Big5", 2026, 4},
+ {"csBig5", 2026, 6},
+ {"macintosh", 2027, 9},
+ {"mac", 2027, 3},
+ {"csMacintosh", 2027, 11},
+ {"IBM037", 2028, 6},
+ {"cp037", 2028, 5},
+ {"ebcdic-cp-us", 2028, 12},
+ {"ebcdic-cp-ca", 2028, 12},
+ {"ebcdic-cp-wt", 2028, 12},
+ {"ebcdic-cp-nl", 2028, 12},
+ {"csIBM037", 2028, 8},
+ {"IBM038", 2029, 6},
+ {"EBCDIC-INT", 2029, 10},
+ {"cp038", 2029, 5},
+ {"csIBM038", 2029, 8},
+ {"IBM273", 2030, 6},
+ {"CP273", 2030, 5},
+ {"csIBM273", 2030, 8},
+ {"IBM274", 2031, 6},
+ {"EBCDIC-BE", 2031, 9},
+ {"CP274", 2031, 5},
+ {"csIBM274", 2031, 8},
+ {"IBM275", 2032, 6},
+ {"EBCDIC-BR", 2032, 9},
+ {"cp275", 2032, 5},
+ {"csIBM275", 2032, 8},
+ {"IBM277", 2033, 6},
+ {"EBCDIC-CP-DK", 2033, 12},
+ {"EBCDIC-CP-NO", 2033, 12},
+ {"csIBM277", 2033, 8},
+ {"IBM278", 2034, 6},
+ {"CP278", 2034, 5},
+ {"ebcdic-cp-fi", 2034, 12},
+ {"ebcdic-cp-se", 2034, 12},
+ {"csIBM278", 2034, 8},
+ {"IBM280", 2035, 6},
+ {"CP280", 2035, 5},
+ {"ebcdic-cp-it", 2035, 12},
+ {"csIBM280", 2035, 8},
+ {"IBM281", 2036, 6},
+ {"EBCDIC-JP-E", 2036, 11},
+ {"cp281", 2036, 5},
+ {"csIBM281", 2036, 8},
+ {"IBM284", 2037, 6},
+ {"CP284", 2037, 5},
+ {"ebcdic-cp-es", 2037, 12},
+ {"csIBM284", 2037, 8},
+ {"IBM285", 2038, 6},
+ {"CP285", 2038, 5},
+ {"ebcdic-cp-gb", 2038, 12},
+ {"csIBM285", 2038, 8},
+ {"IBM290", 2039, 6},
+ {"cp290", 2039, 5},
+ {"EBCDIC-JP-kana", 2039, 14},
+ {"csIBM290", 2039, 8},
+ {"IBM297", 2040, 6},
+ {"cp297", 2040, 5},
+ {"ebcdic-cp-fr", 2040, 12},
+ {"csIBM297", 2040, 8},
+ {"IBM420", 2041, 6},
+ {"cp420", 2041, 5},
+ {"ebcdic-cp-ar1", 2041, 13},
+ {"csIBM420", 2041, 8},
+ {"IBM423", 2042, 6},
+ {"cp423", 2042, 5},
+ {"ebcdic-cp-gr", 2042, 12},
+ {"csIBM423", 2042, 8},
+ {"IBM424", 2043, 6},
+ {"cp424", 2043, 5},
+ {"ebcdic-cp-he", 2043, 12},
+ {"csIBM424", 2043, 8},
+ {"IBM500", 2044, 6},
+ {"CP500", 2044, 5},
+ {"ebcdic-cp-be", 2044, 12},
+ {"ebcdic-cp-ch", 2044, 12},
+ {"csIBM500", 2044, 8},
+ {"IBM851", 2045, 6},
+ {"cp851", 2045, 5},
+ {"851", 2045, 3},
+ {"csIBM851", 2045, 8},
+ {"IBM855", 2046, 6},
+ {"cp855", 2046, 5},
+ {"855", 2046, 3},
+ {"csIBM855", 2046, 8},
+ {"IBM857", 2047, 6},
+ {"cp857", 2047, 5},
+ {"857", 2047, 3},
+ {"csIBM857", 2047, 8},
+ {"IBM860", 2048, 6},
+ {"cp860", 2048, 5},
+ {"860", 2048, 3},
+ {"csIBM860", 2048, 8},
+ {"IBM861", 2049, 6},
+ {"cp861", 2049, 5},
+ {"861", 2049, 3},
+ {"cp-is", 2049, 5},
+ {"csIBM861", 2049, 8},
+ {"IBM863", 2050, 6},
+ {"cp863", 2050, 5},
+ {"863", 2050, 3},
+ {"csIBM863", 2050, 8},
+ {"IBM864", 2051, 6},
+ {"cp864", 2051, 5},
+ {"csIBM864", 2051, 8},
+ {"IBM865", 2052, 6},
+ {"cp865", 2052, 5},
+ {"865", 2052, 3},
+ {"csIBM865", 2052, 8},
+ {"IBM868", 2053, 6},
+ {"CP868", 2053, 5},
+ {"cp-ar", 2053, 5},
+ {"csIBM868", 2053, 8},
+ {"IBM869", 2054, 6},
+ {"cp869", 2054, 5},
+ {"869", 2054, 3},
+ {"cp-gr", 2054, 5},
+ {"csIBM869", 2054, 8},
+ {"IBM870", 2055, 6},
+ {"CP870", 2055, 5},
+ {"ebcdic-cp-roece", 2055, 15},
+ {"ebcdic-cp-yu", 2055, 12},
+ {"csIBM870", 2055, 8},
+ {"IBM871", 2056, 6},
+ {"CP871", 2056, 5},
+ {"ebcdic-cp-is", 2056, 12},
+ {"csIBM871", 2056, 8},
+ {"IBM880", 2057, 6},
+ {"cp880", 2057, 5},
+ {"EBCDIC-Cyrillic", 2057, 15},
+ {"csIBM880", 2057, 8},
+ {"IBM891", 2058, 6},
+ {"cp891", 2058, 5},
+ {"csIBM891", 2058, 8},
+ {"IBM903", 2059, 6},
+ {"cp903", 2059, 5},
+ {"csIBM903", 2059, 8},
+ {"IBM904", 2060, 6},
+ {"cp904", 2060, 5},
+ {"904", 2060, 3},
+ {"csIBBM904", 2060, 9},
+ {"IBM905", 2061, 6},
+ {"CP905", 2061, 5},
+ {"ebcdic-cp-tr", 2061, 12},
+ {"csIBM905", 2061, 8},
+ {"IBM918", 2062, 6},
+ {"CP918", 2062, 5},
+ {"ebcdic-cp-ar2", 2062, 13},
+ {"csIBM918", 2062, 8},
+ {"IBM1026", 2063, 7},
+ {"CP1026", 2063, 6},
+ {"csIBM1026", 2063, 9},
+ {"EBCDIC-AT-DE", 2064, 12},
+ {"csIBMEBCDICATDE", 2064, 15},
+ {"EBCDIC-AT-DE-A", 2065, 14},
+ {"csEBCDICATDEA", 2065, 13},
+ {"EBCDIC-CA-FR", 2066, 12},
+ {"csEBCDICCAFR", 2066, 12},
+ {"EBCDIC-DK-NO", 2067, 12},
+ {"csEBCDICDKNO", 2067, 12},
+ {"EBCDIC-DK-NO-A", 2068, 14},
+ {"csEBCDICDKNOA", 2068, 13},
+ {"EBCDIC-FI-SE", 2069, 12},
+ {"csEBCDICFISE", 2069, 12},
+ {"EBCDIC-FI-SE-A", 2070, 14},
+ {"csEBCDICFISEA", 2070, 13},
+ {"EBCDIC-FR", 2071, 9},
+ {"csEBCDICFR", 2071, 10},
+ {"EBCDIC-IT", 2072, 9},
+ {"csEBCDICIT", 2072, 10},
+ {"EBCDIC-PT", 2073, 9},
+ {"csEBCDICPT", 2073, 10},
+ {"EBCDIC-ES", 2074, 9},
+ {"csEBCDICES", 2074, 10},
+ {"EBCDIC-ES-A", 2075, 11},
+ {"csEBCDICESA", 2075, 11},
+ {"EBCDIC-ES-S", 2076, 11},
+ {"csEBCDICESS", 2076, 11},
+ {"EBCDIC-UK", 2077, 9},
+ {"csEBCDICUK", 2077, 10},
+ {"EBCDIC-US", 2078, 9},
+ {"csEBCDICUS", 2078, 10},
+ {"UNKNOWN-8BIT", 2079, 12},
+ {"csUnknown8BiT", 2079, 13},
+ {"MNEMONIC", 2080, 8},
+ {"csMnemonic", 2080, 10},
+ {"MNEM", 2081, 4},
+ {"csMnem", 2081, 6},
+ {"VISCII", 2082, 6},
+ {"csVISCII", 2082, 8},
+ {"VIQR", 2083, 4},
+ {"csVIQR", 2083, 6},
+ {"KOI8-R", 2084, 6},
+ {"csKOI8R", 2084, 7},
+ {"HZ-GB-2312", 2085, 10},
+ {"IBM866", 2086, 6},
+ {"cp866", 2086, 5},
+ {"866", 2086, 3},
+ {"csIBM866", 2086, 8},
+ {"IBM775", 2087, 6},
+ {"cp775", 2087, 5},
+ {"csPC775Baltic", 2087, 13},
+ {"KOI8-U", 2088, 6},
+ {"csKOI8U", 2088, 7},
+ {"IBM00858", 2089, 8},
+ {"CCSID00858", 2089, 10},
+ {"CP00858", 2089, 7},
+ {"PC-Multilingual-850+euro", 2089, 24},
+ {"csIBM00858", 2089, 10},
+ {"IBM00924", 2090, 8},
+ {"CCSID00924", 2090, 10},
+ {"CP00924", 2090, 7},
+ {"ebcdic-Latin9--euro", 2090, 19},
+ {"csIBM00924", 2090, 10},
+ {"IBM01140", 2091, 8},
+ {"CCSID01140", 2091, 10},
+ {"CP01140", 2091, 7},
+ {"ebcdic-us-37+euro", 2091, 17},
+ {"csIBM01140", 2091, 10},
+ {"IBM01141", 2092, 8},
+ {"CCSID01141", 2092, 10},
+ {"CP01141", 2092, 7},
+ {"ebcdic-de-273+euro", 2092, 18},
+ {"csIBM01141", 2092, 10},
+ {"IBM01142", 2093, 8},
+ {"CCSID01142", 2093, 10},
+ {"CP01142", 2093, 7},
+ {"ebcdic-dk-277+euro", 2093, 18},
+ {"ebcdic-no-277+euro", 2093, 18},
+ {"csIBM01142", 2093, 10},
+ {"IBM01143", 2094, 8},
+ {"CCSID01143", 2094, 10},
+ {"CP01143", 2094, 7},
+ {"ebcdic-fi-278+euro", 2094, 18},
+ {"ebcdic-se-278+euro", 2094, 18},
+ {"csIBM01143", 2094, 10},
+ {"IBM01144", 2095, 8},
+ {"CCSID01144", 2095, 10},
+ {"CP01144", 2095, 7},
+ {"ebcdic-it-280+euro", 2095, 18},
+ {"csIBM01144", 2095, 10},
+ {"IBM01145", 2096, 8},
+ {"CCSID01145", 2096, 10},
+ {"CP01145", 2096, 7},
+ {"ebcdic-es-284+euro", 2096, 18},
+ {"csIBM01145", 2096, 10},
+ {"IBM01146", 2097, 8},
+ {"CCSID01146", 2097, 10},
+ {"CP01146", 2097, 7},
+ {"ebcdic-gb-285+euro", 2097, 18},
+ {"csIBM01146", 2097, 10},
+ {"IBM01147", 2098, 8},
+ {"CCSID01147", 2098, 10},
+ {"CP01147", 2098, 7},
+ {"ebcdic-fr-297+euro", 2098, 18},
+ {"csIBM01147", 2098, 10},
+ {"IBM01148", 2099, 8},
+ {"CCSID01148", 2099, 10},
+ {"CP01148", 2099, 7},
+ {"ebcdic-international-500+euro", 2099, 29},
+ {"csIBM01148", 2099, 10},
+ {"IBM01149", 2100, 8},
+ {"CCSID01149", 2100, 10},
+ {"CP01149", 2100, 7},
+ {"ebcdic-is-871+euro", 2100, 18},
+ {"csIBM01149", 2100, 10},
+ {"Big5-HKSCS", 2101, 10},
+ {"csBig5HKSCS", 2101, 11},
+ {"IBM1047", 2102, 7},
+ {"IBM-1047", 2102, 8},
+ {"csIBM1047", 2102, 9},
+ {"PTCP154", 2103, 7},
+ {"csPTCP154", 2103, 9},
+ {"PT154", 2103, 5},
+ {"CP154", 2103, 5},
+ {"Cyrillic-Asian", 2103, 14},
+ {"Amiga-1251", 2104, 10},
+ {"Ami1251", 2104, 7},
+ {"Amiga1251", 2104, 9},
+ {"Ami-1251", 2104, 8},
+ {"csAmiga1251", 2104, 11},
+ {"KOI7-switched", 2105, 13},
+ {"csKOI7switched", 2105, 14},
+ {"BRF", 2106, 3},
+ {"csBRF", 2106, 5},
+ {"TSCII", 2107, 5},
+ {"csTSCII", 2107, 7},
+ {"CP51932", 2108, 7},
+ {"csCP51932", 2108, 9},
+ {"windows-874", 2109, 11},
+ {"cswindows874", 2109, 12},
+ {"windows-1250", 2250, 12},
+ {"cswindows1250", 2250, 13},
+ {"windows-1251", 2251, 12},
+ {"cswindows1251", 2251, 13},
+ {"windows-1252", 2252, 12},
+ {"cswindows1252", 2252, 13},
+ {"windows-1253", 2253, 12},
+ {"cswindows1253", 2253, 13},
+ {"windows-1254", 2254, 12},
+ {"cswindows1254", 2254, 13},
+ {"windows-1255", 2255, 12},
+ {"cswindows1255", 2255, 13},
+ {"windows-1256", 2256, 12},
+ {"cswindows1256", 2256, 13},
+ {"windows-1257", 2257, 12},
+ {"cswindows1257", 2257, 13},
+ {"windows-1258", 2258, 12},
+ {"cswindows1258", 2258, 13},
+ {"TIS-620", 2259, 7},
+ {"csTIS620", 2259, 8},
+ {"ISO-8859-11", 2259, 11},
+ {"CP50220", 2260, 7},
+ {"csCP50220", 2260, 9},
+};
- {1, ""},
- {2, ""},
- {3, "ANSI_X3.4-1968"},
- {3, "ANSI_X3.4-1986"},
- {3, "IBM367"},
- {3, "ISO646-US"},
- {3, "ISO_646.irv:1991"},
- {3, "cp367"},
- {3, "csASCII"},
- {3, "iso-ir-6"},
- {3, "us"},
- {4, "ISO-8859-1"},
- {4, "ISO_8859-1:1987"},
- {4, "CP819"},
- {4, "IBM819"},
- {4, "ISO_8859-1"},
- {4, "csISOLatin1"},
- {4, "iso-ir-100"},
- {4, "l1"},
- {4, "latin1"},
- {5, "ISO-8859-2"},
- {5, "ISO_8859-2:1987"},
- {5, "ISO_8859-2"},
- {5, "csISOLatin2"},
- {5, "iso-ir-101"},
- {5, "l2"},
- {5, "latin2"},
- {6, "ISO-8859-3"},
- {6, "ISO_8859-3:1988"},
- {6, "ISO_8859-3"},
- {6, "csISOLatin3"},
- {6, "iso-ir-109"},
- {6, "l3"},
- {6, "latin3"},
- {7, "ISO-8859-4"},
- {7, "ISO_8859-4:1988"},
- {7, "ISO_8859-4"},
- {7, "csISOLatin4"},
- {7, "iso-ir-110"},
- {7, "l4"},
- {7, "latin4"},
- {8, "ISO-8859-5"},
- {8, "ISO_8859-5:1988"},
- {8, "ISO_8859-5"},
- {8, "csISOLatinCyrillic"},
- {8, "cyrillic"},
- {8, "iso-ir-144"},
- {9, "ISO-8859-6"},
- {9, "ISO_8859-6:1987"},
- {9, "ASMO-708"},
- {9, "ECMA-114"},
- {9, "ISO_8859-6"},
- {9, "arabic"},
- {9, "csISOLatinArabic"},
- {9, "iso-ir-127"},
- {10, "ISO-8859-7"},
- {10, "ISO_8859-7:1987"},
- {10, "ECMA-118"},
- {10, "ELOT_928"},
- {10, "ISO_8859-7"},
- {10, "csISOLatinGreek"},
- {10, "greek"},
- {10, "greek8"},
- {10, "iso-ir-126"},
- {11, "ISO-8859-8"},
- {11, "ISO_8859-8:1988"},
- {11, "ISO_8859-8"},
- {11, "csISOLatinHebrew"},
- {11, "hebrew"},
- {11, "iso-ir-138"},
- {12, "ISO-8859-9"},
- {12, "ISO_8859-9:1989"},
- {12, "ISO_8859-9"},
- {12, "csISOLatin5"},
- {12, "iso-ir-148"},
- {12, "l5"},
- {12, "latin5"},
- {13, "ISO-8859-10"},
- {13, "ISO_8859-10:1992"},
- {13, "csISOLatin6"},
- {13, "iso-ir-157"},
- {13, "l6"},
- {13, "latin6"},
- {14, "ISO_6937-2-add"},
- {14, "csISOTextComm"},
- {14, "iso-ir-142"},
- {15, "JIS_X0201"},
- {15, "X0201"},
- {15, "csHalfWidthKatakana"},
- {16, "JIS_Encoding"},
- {16, "csJISEncoding"},
- {17, "Shift_JIS"},
- {17, "MS_Kanji"},
- {17, "csShiftJIS"},
- {18, "EUC-JP"},
- {18, "Extended_UNIX_Code_Packed_Format_for_Japanese"},
- {18, "csEUCPkdFmtJapanese"},
- {19, "Extended_UNIX_Code_Fixed_Width_for_Japanese"},
- {19, "csEUCFixWidJapanese"},
- {20, "BS_4730"},
- {20, "ISO646-GB"},
- {20, "csISO4UnitedKingdom"},
- {20, "gb"},
- {20, "iso-ir-4"},
- {20, "uk"},
- {21, "SEN_850200_C"},
- {21, "ISO646-SE2"},
- {21, "csISO11SwedishForNames"},
- {21, "iso-ir-11"},
- {21, "se2"},
- {22, "IT"},
- {22, "ISO646-IT"},
- {22, "csISO15Italian"},
- {22, "iso-ir-15"},
- {23, "ES"},
- {23, "ISO646-ES"},
- {23, "csISO17Spanish"},
- {23, "iso-ir-17"},
- {24, "DIN_66003"},
- {24, "ISO646-DE"},
- {24, "csISO21German"},
- {24, "de"},
- {24, "iso-ir-21"},
- {25, "NS_4551-1"},
- {25, "ISO646-NO"},
- {25, "csISO60DanishNorwegian"},
- {25, "csISO60Norwegian1"},
- {25, "iso-ir-60"},
- {25, "no"},
- {26, "NF_Z_62-010"},
- {26, "ISO646-FR"},
- {26, "csISO69French"},
- {26, "fr"},
- {26, "iso-ir-69"},
- {27, "ISO-10646-UTF-1"},
- {27, "csISO10646UTF1"},
- {28, "ISO_646.basic:1983"},
- {28, "csISO646basic1983"},
- {28, "ref"},
- {29, "INVARIANT"},
- {29, "csINVARIANT"},
- {30, "ISO_646.irv:1983"},
- {30, "csISO2IntlRefVersion"},
- {30, "irv"},
- {30, "iso-ir-2"},
- {31, "NATS-SEFI"},
- {31, "csNATSSEFI"},
- {31, "iso-ir-8-1"},
- {32, "NATS-SEFI-ADD"},
- {32, "csNATSSEFIADD"},
- {32, "iso-ir-8-2"},
- {35, "SEN_850200_B"},
- {35, "FI"},
- {35, "ISO646-FI"},
- {35, "ISO646-SE"},
- {35, "csISO10Swedish"},
- {35, "iso-ir-10"},
- {35, "se"},
- {36, "KS_C_5601-1987"},
- {36, "KSC_5601"},
- {36, "KS_C_5601-1989"},
- {36, "csKSC56011987"},
- {36, "iso-ir-149"},
- {36, "korean"},
- {37, "ISO-2022-KR"},
- {37, "csISO2022KR"},
- {38, "EUC-KR"},
- {38, "csEUCKR"},
- {39, "ISO-2022-JP"},
- {39, "csISO2022JP"},
- {40, "ISO-2022-JP-2"},
- {40, "csISO2022JP2"},
- {41, "JIS_C6220-1969-jp"},
- {41, "JIS_C6220-1969"},
- {41, "csISO13JISC6220jp"},
- {41, "iso-ir-13"},
- {41, "katakana"},
- {41, "x0201-7"},
- {42, "JIS_C6220-1969-ro"},
- {42, "ISO646-JP"},
- {42, "csISO14JISC6220ro"},
- {42, "iso-ir-14"},
- {42, "jp"},
- {43, "PT"},
- {43, "ISO646-PT"},
- {43, "csISO16Portuguese"},
- {43, "iso-ir-16"},
- {44, "greek7-old"},
- {44, "csISO18Greek7Old"},
- {44, "iso-ir-18"},
- {45, "latin-greek"},
- {45, "csISO19LatinGreek"},
- {45, "iso-ir-19"},
- {46, "NF_Z_62-010_(1973)"},
- {46, "ISO646-FR1"},
- {46, "csISO25French"},
- {46, "iso-ir-25"},
- {47, "Latin-greek-1"},
- {47, "csISO27LatinGreek1"},
- {47, "iso-ir-27"},
- {48, "ISO_5427"},
- {48, "csISO5427Cyrillic"},
- {48, "iso-ir-37"},
- {49, "JIS_C6226-1978"},
- {49, "csISO42JISC62261978"},
- {49, "iso-ir-42"},
- {50, "BS_viewdata"},
- {50, "csISO47BSViewdata"},
- {50, "iso-ir-47"},
- {51, "INIS"},
- {51, "csISO49INIS"},
- {51, "iso-ir-49"},
- {52, "INIS-8"},
- {52, "csISO50INIS8"},
- {52, "iso-ir-50"},
- {53, "INIS-cyrillic"},
- {53, "csISO51INISCyrillic"},
- {53, "iso-ir-51"},
- {54, "ISO_5427:1981"},
- {54, "ISO5427Cyrillic1981"},
- {54, "csISO54271981"},
- {54, "iso-ir-54"},
- {55, "ISO_5428:1980"},
- {55, "csISO5428Greek"},
- {55, "iso-ir-55"},
- {56, "GB_1988-80"},
- {56, "ISO646-CN"},
- {56, "cn"},
- {56, "csISO57GB1988"},
- {56, "iso-ir-57"},
- {57, "GB_2312-80"},
- {57, "chinese"},
- {57, "csISO58GB231280"},
- {57, "iso-ir-58"},
- {58, "NS_4551-2"},
- {58, "ISO646-NO2"},
- {58, "csISO61Norwegian2"},
- {58, "iso-ir-61"},
- {58, "no2"},
- {59, "videotex-suppl"},
- {59, "csISO70VideotexSupp1"},
- {59, "iso-ir-70"},
- {60, "PT2"},
- {60, "ISO646-PT2"},
- {60, "csISO84Portuguese2"},
- {60, "iso-ir-84"},
- {61, "ES2"},
- {61, "ISO646-ES2"},
- {61, "csISO85Spanish2"},
- {61, "iso-ir-85"},
- {62, "MSZ_7795.3"},
- {62, "ISO646-HU"},
- {62, "csISO86Hungarian"},
- {62, "hu"},
- {62, "iso-ir-86"},
- {63, "JIS_C6226-1983"},
- {63, "JIS_X0208-1983"},
- {63, "csISO87JISX0208"},
- {63, "iso-ir-87"},
- {63, "x0208"},
- {64, "greek7"},
- {64, "csISO88Greek7"},
- {64, "iso-ir-88"},
- {65, "ASMO_449"},
- {65, "ISO_9036"},
- {65, "arabic7"},
- {65, "csISO89ASMO449"},
- {65, "iso-ir-89"},
- {66, "iso-ir-90"},
- {66, "csISO90"},
- {67, "JIS_C6229-1984-a"},
- {67, "csISO91JISC62291984a"},
- {67, "iso-ir-91"},
- {67, "jp-ocr-a"},
- {68, "JIS_C6229-1984-b"},
- {68, "ISO646-JP-OCR-B"},
- {68, "csISO92JISC62991984b"},
- {68, "iso-ir-92"},
- {68, "jp-ocr-b"},
- {69, "JIS_C6229-1984-b-add"},
- {69, "csISO93JIS62291984badd"},
- {69, "iso-ir-93"},
- {69, "jp-ocr-b-add"},
- {70, "JIS_C6229-1984-hand"},
- {70, "csISO94JIS62291984hand"},
- {70, "iso-ir-94"},
- {70, "jp-ocr-hand"},
- {71, "JIS_C6229-1984-hand-add"},
- {71, "csISO95JIS62291984handadd"},
- {71, "iso-ir-95"},
- {71, "jp-ocr-hand-add"},
- {72, "JIS_C6229-1984-kana"},
- {72, "csISO96JISC62291984kana"},
- {72, "iso-ir-96"},
- {73, "ISO_2033-1983"},
- {73, "csISO2033"},
- {73, "e13b"},
- {73, "iso-ir-98"},
- {74, "ANSI_X3.110-1983"},
- {74, "CSA_T500-1983"},
- {74, "NAPLPS"},
- {74, "csISO99NAPLPS"},
- {74, "iso-ir-99"},
- {75, "T.61-7bit"},
- {75, "csISO102T617bit"},
- {75, "iso-ir-102"},
- {76, "T.61-8bit"},
- {76, "T.61"},
- {76, "csISO103T618bit"},
- {76, "iso-ir-103"},
- {77, "ECMA-cyrillic"},
- {77, "KOI8-E"},
- {77, "csISO111ECMACyrillic"},
- {77, "iso-ir-111"},
- {78, "CSA_Z243.4-1985-1"},
- {78, "ISO646-CA"},
- {78, "ca"},
- {78, "csISO121Canadian1"},
- {78, "csa7-1"},
- {78, "csa71"},
- {78, "iso-ir-121"},
- {79, "CSA_Z243.4-1985-2"},
- {79, "ISO646-CA2"},
- {79, "csISO122Canadian2"},
- {79, "csa7-2"},
- {79, "csa72"},
- {79, "iso-ir-122"},
- {80, "CSA_Z243.4-1985-gr"},
- {80, "csISO123CSAZ24341985gr"},
- {80, "iso-ir-123"},
- {81, "ISO-8859-6-E"},
- {81, "ISO_8859-6-E"},
- {81, "csISO88596E"},
- {82, "ISO-8859-6-I"},
- {82, "ISO_8859-6-I"},
- {82, "csISO88596I"},
- {83, "T.101-G2"},
- {83, "csISO128T101G2"},
- {83, "iso-ir-128"},
- {84, "ISO-8859-8-E"},
- {84, "ISO_8859-8-E"},
- {84, "csISO88598E"},
- {85, "ISO-8859-8-I"},
- {85, "ISO_8859-8-I"},
- {85, "csISO88598I"},
- {86, "CSN_369103"},
- {86, "csISO139CSN369103"},
- {86, "iso-ir-139"},
- {87, "JUS_I.B1.002"},
- {87, "ISO646-YU"},
- {87, "csISO141JUSIB1002"},
- {87, "iso-ir-141"},
- {87, "js"},
- {87, "yu"},
- {88, "IEC_P27-1"},
- {88, "csISO143IECP271"},
- {88, "iso-ir-143"},
- {89, "JUS_I.B1.003-serb"},
- {89, "csISO146Serbian"},
- {89, "iso-ir-146"},
- {89, "serbian"},
- {90, "JUS_I.B1.003-mac"},
- {90, "csISO147Macedonian"},
- {90, "iso-ir-147"},
- {90, "macedonian"},
- {91, "greek-ccitt"},
- {91, "csISO150"},
- {91, "csISO150GreekCCITT"},
- {91, "iso-ir-150"},
- {92, "NC_NC00-10:81"},
- {92, "ISO646-CU"},
- {92, "csISO151Cuba"},
- {92, "cuba"},
- {92, "iso-ir-151"},
- {93, "ISO_6937-2-25"},
- {93, "csISO6937Add"},
- {93, "iso-ir-152"},
- {94, "GOST_19768-74"},
- {94, "ST_SEV_358-88"},
- {94, "csISO153GOST1976874"},
- {94, "iso-ir-153"},
- {95, "ISO_8859-supp"},
- {95, "csISO8859Supp"},
- {95, "iso-ir-154"},
- {95, "latin1-2-5"},
- {96, "ISO_10367-box"},
- {96, "csISO10367Box"},
- {96, "iso-ir-155"},
- {97, "latin-lap"},
- {97, "csISO158Lap"},
- {97, "iso-ir-158"},
- {97, "lap"},
- {98, "JIS_X0212-1990"},
- {98, "csISO159JISX02121990"},
- {98, "iso-ir-159"},
- {98, "x0212"},
- {99, "DS_2089"},
- {99, "DS2089"},
- {99, "ISO646-DK"},
- {99, "csISO646Danish"},
- {99, "dk"},
- {100, "us-dk"},
- {100, "csUSDK"},
- {101, "dk-us"},
- {101, "csDKUS"},
- {102, "KSC5636"},
- {102, "ISO646-KR"},
- {102, "csKSC5636"},
- {103, "UNICODE-1-1-UTF-7"},
- {103, "csUnicode11UTF7"},
- {104, "ISO-2022-CN"},
- {104, "csISO2022CN"},
- {105, "ISO-2022-CN-EXT"},
- {105, "csISO2022CNEXT"},
- {106, "UTF-8"},
- {106, "csUTF8"},
- {109, "ISO-8859-13"},
- {109, "csISO885913"},
- {110, "ISO-8859-14"},
- {110, "ISO_8859-14"},
- {110, "ISO_8859-14:1998"},
- {110, "csISO885914"},
- {110, "iso-celtic"},
- {110, "iso-ir-199"},
- {110, "l8"},
- {110, "latin8"},
- {111, "ISO-8859-15"},
- {111, "ISO_8859-15"},
- {111, "Latin-9"},
- {111, "csISO885915"},
- {112, "ISO-8859-16"},
- {112, "ISO_8859-16"},
- {112, "ISO_8859-16:2001"},
- {112, "csISO885916"},
- {112, "iso-ir-226"},
- {112, "l10"},
- {112, "latin10"},
- {113, "GBK"},
- {113, "CP936"},
- {113, "MS936"},
- {113, "csGBK"},
- {113, "windows-936"},
- {114, "GB18030"},
- {114, "csGB18030"},
- {115, "OSD_EBCDIC_DF04_15"},
- {115, "csOSDEBCDICDF0415"},
- {116, "OSD_EBCDIC_DF03_IRV"},
- {116, "csOSDEBCDICDF03IRV"},
- {117, "OSD_EBCDIC_DF04_1"},
- {117, "csOSDEBCDICDF041"},
- {118, "ISO-11548-1"},
- {118, "ISO_11548-1"},
- {118, "ISO_TR_11548-1"},
- {118, "csISO115481"},
- {119, "KZ-1048"},
- {119, "RK1048"},
- {119, "STRK1048-2002"},
- {119, "csKZ1048"},
- {1000, "ISO-10646-UCS-2"},
- {1000, "csUnicode"},
- {1001, "ISO-10646-UCS-4"},
- {1001, "csUCS4"},
- {1002, "ISO-10646-UCS-Basic"},
- {1002, "csUnicodeASCII"},
- {1003, "ISO-10646-Unicode-Latin1"},
- {1003, "ISO-10646"},
- {1003, "csUnicodeLatin1"},
- {1004, "ISO-10646-J-1"},
- {1004, "csUnicodeJapanese"},
- {1005, "ISO-Unicode-IBM-1261"},
- {1005, "csUnicodeIBM1261"},
- {1006, "ISO-Unicode-IBM-1268"},
- {1006, "csUnicodeIBM1268"},
- {1007, "ISO-Unicode-IBM-1276"},
- {1007, "csUnicodeIBM1276"},
- {1008, "ISO-Unicode-IBM-1264"},
- {1008, "csUnicodeIBM1264"},
- {1009, "ISO-Unicode-IBM-1265"},
- {1009, "csUnicodeIBM1265"},
- {1010, "UNICODE-1-1"},
- {1010, "csUnicode11"},
- {1011, "SCSU"},
- {1011, "csSCSU"},
- {1012, "UTF-7"},
- {1012, "csUTF7"},
- {1013, "UTF-16BE"},
- {1013, "csUTF16BE"},
- {1014, "UTF-16LE"},
- {1014, "csUTF16LE"},
- {1015, "UTF-16"},
- {1015, "csUTF16"},
- {1016, "CESU-8"},
- {1016, "csCESU-8"},
- {1016, "csCESU8"},
- {1017, "UTF-32"},
- {1017, "csUTF32"},
- {1018, "UTF-32BE"},
- {1018, "csUTF32BE"},
- {1019, "UTF-32LE"},
- {1019, "csUTF32LE"},
- {1020, "BOCU-1"},
- {1020, "csBOCU-1"},
- {1020, "csBOCU1"},
- {1021, "UTF-7-IMAP"},
- {1021, "csUTF7IMAP"},
- {2000, "ISO-8859-1-Windows-3.0-Latin-1"},
- {2000, "csWindows30Latin1"},
- {2001, "ISO-8859-1-Windows-3.1-Latin-1"},
- {2001, "csWindows31Latin1"},
- {2002, "ISO-8859-2-Windows-Latin-2"},
- {2002, "csWindows31Latin2"},
- {2003, "ISO-8859-9-Windows-Latin-5"},
- {2003, "csWindows31Latin5"},
- {2004, "hp-roman8"},
- {2004, "csHPRoman8"},
- {2004, "r8"},
- {2004, "roman8"},
- {2005, "Adobe-Standard-Encoding"},
- {2005, "csAdobeStandardEncoding"},
- {2006, "Ventura-US"},
- {2006, "csVenturaUS"},
- {2007, "Ventura-International"},
- {2007, "csVenturaInternational"},
- {2008, "DEC-MCS"},
- {2008, "csDECMCS"},
- {2008, "dec"},
- {2009, "IBM850"},
- {2009, "850"},
- {2009, "cp850"},
- {2009, "csPC850Multilingual"},
- {2010, "IBM852"},
- {2010, "852"},
- {2010, "cp852"},
- {2010, "csPCp852"},
- {2011, "IBM437"},
- {2011, "437"},
- {2011, "cp437"},
- {2011, "csPC8CodePage437"},
- {2012, "PC8-Danish-Norwegian"},
- {2012, "csPC8DanishNorwegian"},
- {2013, "IBM862"},
- {2013, "862"},
- {2013, "cp862"},
- {2013, "csPC862LatinHebrew"},
- {2014, "PC8-Turkish"},
- {2014, "csPC8Turkish"},
- {2015, "IBM-Symbols"},
- {2015, "csIBMSymbols"},
- {2016, "IBM-Thai"},
- {2016, "csIBMThai"},
- {2017, "HP-Legal"},
- {2017, "csHPLegal"},
- {2018, "HP-Pi-font"},
- {2018, "csHPPiFont"},
- {2019, "HP-Math8"},
- {2019, "csHPMath8"},
- {2020, "Adobe-Symbol-Encoding"},
- {2020, "csHPPSMath"},
- {2021, "HP-DeskTop"},
- {2021, "csHPDesktop"},
- {2022, "Ventura-Math"},
- {2022, "csVenturaMath"},
- {2023, "Microsoft-Publishing"},
- {2023, "csMicrosoftPublishing"},
- {2024, "Windows-31J"},
- {2024, "csWindows31J"},
- {2025, "GB2312"},
- {2025, "csGB2312"},
- {2026, "Big5"},
- {2026, "csBig5"},
- {2027, "macintosh"},
- {2027, "csMacintosh"},
- {2027, "mac"},
- {2028, "IBM037"},
- {2028, "cp037"},
- {2028, "csIBM037"},
- {2028, "ebcdic-cp-ca"},
- {2028, "ebcdic-cp-nl"},
- {2028, "ebcdic-cp-us"},
- {2028, "ebcdic-cp-wt"},
- {2029, "IBM038"},
- {2029, "EBCDIC-INT"},
- {2029, "cp038"},
- {2029, "csIBM038"},
- {2030, "IBM273"},
- {2030, "CP273"},
- {2030, "csIBM273"},
- {2031, "IBM274"},
- {2031, "CP274"},
- {2031, "EBCDIC-BE"},
- {2031, "csIBM274"},
- {2032, "IBM275"},
- {2032, "EBCDIC-BR"},
- {2032, "cp275"},
- {2032, "csIBM275"},
- {2033, "IBM277"},
- {2033, "EBCDIC-CP-DK"},
- {2033, "EBCDIC-CP-NO"},
- {2033, "csIBM277"},
- {2034, "IBM278"},
- {2034, "CP278"},
- {2034, "csIBM278"},
- {2034, "ebcdic-cp-fi"},
- {2034, "ebcdic-cp-se"},
- {2035, "IBM280"},
- {2035, "CP280"},
- {2035, "csIBM280"},
- {2035, "ebcdic-cp-it"},
- {2036, "IBM281"},
- {2036, "EBCDIC-JP-E"},
- {2036, "cp281"},
- {2036, "csIBM281"},
- {2037, "IBM284"},
- {2037, "CP284"},
- {2037, "csIBM284"},
- {2037, "ebcdic-cp-es"},
- {2038, "IBM285"},
- {2038, "CP285"},
- {2038, "csIBM285"},
- {2038, "ebcdic-cp-gb"},
- {2039, "IBM290"},
- {2039, "EBCDIC-JP-kana"},
- {2039, "cp290"},
- {2039, "csIBM290"},
- {2040, "IBM297"},
- {2040, "cp297"},
- {2040, "csIBM297"},
- {2040, "ebcdic-cp-fr"},
- {2041, "IBM420"},
- {2041, "cp420"},
- {2041, "csIBM420"},
- {2041, "ebcdic-cp-ar1"},
- {2042, "IBM423"},
- {2042, "cp423"},
- {2042, "csIBM423"},
- {2042, "ebcdic-cp-gr"},
- {2043, "IBM424"},
- {2043, "cp424"},
- {2043, "csIBM424"},
- {2043, "ebcdic-cp-he"},
- {2044, "IBM500"},
- {2044, "CP500"},
- {2044, "csIBM500"},
- {2044, "ebcdic-cp-be"},
- {2044, "ebcdic-cp-ch"},
- {2045, "IBM851"},
- {2045, "851"},
- {2045, "cp851"},
- {2045, "csIBM851"},
- {2046, "IBM855"},
- {2046, "855"},
- {2046, "cp855"},
- {2046, "csIBM855"},
- {2047, "IBM857"},
- {2047, "857"},
- {2047, "cp857"},
- {2047, "csIBM857"},
- {2048, "IBM860"},
- {2048, "860"},
- {2048, "cp860"},
- {2048, "csIBM860"},
- {2049, "IBM861"},
- {2049, "861"},
- {2049, "cp-is"},
- {2049, "cp861"},
- {2049, "csIBM861"},
- {2050, "IBM863"},
- {2050, "863"},
- {2050, "cp863"},
- {2050, "csIBM863"},
- {2051, "IBM864"},
- {2051, "cp864"},
- {2051, "csIBM864"},
- {2052, "IBM865"},
- {2052, "865"},
- {2052, "cp865"},
- {2052, "csIBM865"},
- {2053, "IBM868"},
- {2053, "CP868"},
- {2053, "cp-ar"},
- {2053, "csIBM868"},
- {2054, "IBM869"},
- {2054, "869"},
- {2054, "cp-gr"},
- {2054, "cp869"},
- {2054, "csIBM869"},
- {2055, "IBM870"},
- {2055, "CP870"},
- {2055, "csIBM870"},
- {2055, "ebcdic-cp-roece"},
- {2055, "ebcdic-cp-yu"},
- {2056, "IBM871"},
- {2056, "CP871"},
- {2056, "csIBM871"},
- {2056, "ebcdic-cp-is"},
- {2057, "IBM880"},
- {2057, "EBCDIC-Cyrillic"},
- {2057, "cp880"},
- {2057, "csIBM880"},
- {2058, "IBM891"},
- {2058, "cp891"},
- {2058, "csIBM891"},
- {2059, "IBM903"},
- {2059, "cp903"},
- {2059, "csIBM903"},
- {2060, "IBM904"},
- {2060, "904"},
- {2060, "cp904"},
- {2060, "csIBBM904"},
- {2061, "IBM905"},
- {2061, "CP905"},
- {2061, "csIBM905"},
- {2061, "ebcdic-cp-tr"},
- {2062, "IBM918"},
- {2062, "CP918"},
- {2062, "csIBM918"},
- {2062, "ebcdic-cp-ar2"},
- {2063, "IBM1026"},
- {2063, "CP1026"},
- {2063, "csIBM1026"},
- {2064, "EBCDIC-AT-DE"},
- {2064, "csIBMEBCDICATDE"},
- {2065, "EBCDIC-AT-DE-A"},
- {2065, "csEBCDICATDEA"},
- {2066, "EBCDIC-CA-FR"},
- {2066, "csEBCDICCAFR"},
- {2067, "EBCDIC-DK-NO"},
- {2067, "csEBCDICDKNO"},
- {2068, "EBCDIC-DK-NO-A"},
- {2068, "csEBCDICDKNOA"},
- {2069, "EBCDIC-FI-SE"},
- {2069, "csEBCDICFISE"},
- {2070, "EBCDIC-FI-SE-A"},
- {2070, "csEBCDICFISEA"},
- {2071, "EBCDIC-FR"},
- {2071, "csEBCDICFR"},
- {2072, "EBCDIC-IT"},
- {2072, "csEBCDICIT"},
- {2073, "EBCDIC-PT"},
- {2073, "csEBCDICPT"},
- {2074, "EBCDIC-ES"},
- {2074, "csEBCDICES"},
- {2075, "EBCDIC-ES-A"},
- {2075, "csEBCDICESA"},
- {2076, "EBCDIC-ES-S"},
- {2076, "csEBCDICESS"},
- {2077, "EBCDIC-UK"},
- {2077, "csEBCDICUK"},
- {2078, "EBCDIC-US"},
- {2078, "csEBCDICUS"},
- {2079, "UNKNOWN-8BIT"},
- {2079, "csUnknown8BiT"},
- {2080, "MNEMONIC"},
- {2080, "csMnemonic"},
- {2081, "MNEM"},
- {2081, "csMnem"},
- {2082, "VISCII"},
- {2082, "csVISCII"},
- {2083, "VIQR"},
- {2083, "csVIQR"},
- {2084, "KOI8-R"},
- {2084, "csKOI8R"},
- {2085, "HZ-GB-2312"},
- {2086, "IBM866"},
- {2086, "866"},
- {2086, "cp866"},
- {2086, "csIBM866"},
- {2087, "IBM775"},
- {2087, "cp775"},
- {2087, "csPC775Baltic"},
- {2088, "KOI8-U"},
- {2088, "csKOI8U"},
- {2089, "IBM00858"},
- {2089, "CCSID00858"},
- {2089, "CP00858"},
- {2089, "PC-Multilingual-850+euro"},
- {2089, "csIBM00858"},
- {2090, "IBM00924"},
- {2090, "CCSID00924"},
- {2090, "CP00924"},
- {2090, "csIBM00924"},
- {2090, "ebcdic-Latin9--euro"},
- {2091, "IBM01140"},
- {2091, "CCSID01140"},
- {2091, "CP01140"},
- {2091, "csIBM01140"},
- {2091, "ebcdic-us-37+euro"},
- {2092, "IBM01141"},
- {2092, "CCSID01141"},
- {2092, "CP01141"},
- {2092, "csIBM01141"},
- {2092, "ebcdic-de-273+euro"},
- {2093, "IBM01142"},
- {2093, "CCSID01142"},
- {2093, "CP01142"},
- {2093, "csIBM01142"},
- {2093, "ebcdic-dk-277+euro"},
- {2093, "ebcdic-no-277+euro"},
- {2094, "IBM01143"},
- {2094, "CCSID01143"},
- {2094, "CP01143"},
- {2094, "csIBM01143"},
- {2094, "ebcdic-fi-278+euro"},
- {2094, "ebcdic-se-278+euro"},
- {2095, "IBM01144"},
- {2095, "CCSID01144"},
- {2095, "CP01144"},
- {2095, "csIBM01144"},
- {2095, "ebcdic-it-280+euro"},
- {2096, "IBM01145"},
- {2096, "CCSID01145"},
- {2096, "CP01145"},
- {2096, "csIBM01145"},
- {2096, "ebcdic-es-284+euro"},
- {2097, "IBM01146"},
- {2097, "CCSID01146"},
- {2097, "CP01146"},
- {2097, "csIBM01146"},
- {2097, "ebcdic-gb-285+euro"},
- {2098, "IBM01147"},
- {2098, "CCSID01147"},
- {2098, "CP01147"},
- {2098, "csIBM01147"},
- {2098, "ebcdic-fr-297+euro"},
- {2099, "IBM01148"},
- {2099, "CCSID01148"},
- {2099, "CP01148"},
- {2099, "csIBM01148"},
- {2099, "ebcdic-international-500+euro"},
- {2100, "IBM01149"},
- {2100, "CCSID01149"},
- {2100, "CP01149"},
- {2100, "csIBM01149"},
- {2100, "ebcdic-is-871+euro"},
- {2101, "Big5-HKSCS"},
- {2101, "csBig5HKSCS"},
- {2102, "IBM1047"},
- {2102, "IBM-1047"},
- {2102, "csIBM1047"},
- {2103, "PTCP154"},
- {2103, "CP154"},
- {2103, "Cyrillic-Asian"},
- {2103, "PT154"},
- {2103, "csPTCP154"},
- {2104, "Amiga-1251"},
- {2104, "Ami-1251"},
- {2104, "Ami1251"},
- {2104, "Amiga1251"},
- {2104, "csAmiga1251"},
- {2105, "KOI7-switched"},
- {2105, "csKOI7switched"},
- {2106, "BRF"},
- {2106, "csBRF"},
- {2107, "TSCII"},
- {2107, "csTSCII"},
- {2108, "CP51932"},
- {2108, "csCP51932"},
- {2109, "windows-874"},
- {2109, "cswindows874"},
- {2250, "windows-1250"},
- {2250, "cswindows1250"},
- {2251, "windows-1251"},
- {2251, "cswindows1251"},
- {2252, "windows-1252"},
- {2252, "cswindows1252"},
- {2253, "windows-1253"},
- {2253, "cswindows1253"},
- {2254, "windows-1254"},
- {2254, "cswindows1254"},
- {2255, "windows-1255"},
- {2255, "cswindows1255"},
- {2256, "windows-1256"},
- {2256, "cswindows1256"},
- {2257, "windows-1257"},
- {2257, "cswindows1257"},
- {2258, "windows-1258"},
- {2258, "cswindows1258"},
- {2259, "TIS-620"},
- {2259, "ISO-8859-11"},
- {2259, "csTIS620"},
- {2260, "CP50220"},
- {2260, "csCP50220"},
-}};
+constexpr const encoding_data unique_encoding_data[]{
+ {"US-ASCII", 3, 8},
+ {"ISO_8859-1:1987", 4, 15},
+ {"ISO_8859-2:1987", 5, 15},
+ {"ISO_8859-3:1988", 6, 15},
+ {"ISO_8859-4:1988", 7, 15},
+ {"ISO_8859-5:1988", 8, 15},
+ {"ISO_8859-6:1987", 9, 15},
+ {"ISO_8859-7:1987", 10, 15},
+ {"ISO_8859-8:1988", 11, 15},
+ {"ISO_8859-9:1989", 12, 15},
+ {"ISO-8859-10", 13, 11},
+ {"ISO_6937-2-add", 14, 14},
+ {"JIS_X0201", 15, 9},
+ {"JIS_Encoding", 16, 12},
+ {"Shift_JIS", 17, 9},
+ {"Extended_UNIX_Code_Packed_Format_for_Japanese", 18, 45},
+ {"Extended_UNIX_Code_Fixed_Width_for_Japanese", 19, 43},
+ {"BS_4730", 20, 7},
+ {"SEN_850200_C", 21, 12},
+ {"IT", 22, 2},
+ {"ES", 23, 2},
+ {"DIN_66003", 24, 9},
+ {"NS_4551-1", 25, 9},
+ {"NF_Z_62-010", 26, 11},
+ {"ISO-10646-UTF-1", 27, 15},
+ {"ISO_646.basic:1983", 28, 18},
+ {"INVARIANT", 29, 9},
+ {"ISO_646.irv:1983", 30, 16},
+ {"NATS-SEFI", 31, 9},
+ {"NATS-SEFI-ADD", 32, 13},
+ {"SEN_850200_B", 35, 12},
+ {"KS_C_5601-1987", 36, 14},
+ {"ISO-2022-KR", 37, 11},
+ {"EUC-KR", 38, 6},
+ {"ISO-2022-JP", 39, 11},
+ {"ISO-2022-JP-2", 40, 13},
+ {"JIS_C6220-1969-jp", 41, 17},
+ {"JIS_C6220-1969-ro", 42, 17},
+ {"PT", 43, 2},
+ {"greek7-old", 44, 10},
+ {"latin-greek", 45, 11},
+ {"NF_Z_62-010_(1973)", 46, 18},
+ {"Latin-greek-1", 47, 13},
+ {"ISO_5427", 48, 8},
+ {"JIS_C6226-1978", 49, 14},
+ {"BS_viewdata", 50, 11},
+ {"INIS", 51, 4},
+ {"INIS-8", 52, 6},
+ {"INIS-cyrillic", 53, 13},
+ {"ISO_5427:1981", 54, 13},
+ {"ISO_5428:1980", 55, 13},
+ {"GB_1988-80", 56, 10},
+ {"GB_2312-80", 57, 10},
+ {"NS_4551-2", 58, 9},
+ {"videotex-suppl", 59, 14},
+ {"PT2", 60, 3},
+ {"ES2", 61, 3},
+ {"MSZ_7795.3", 62, 10},
+ {"JIS_C6226-1983", 63, 14},
+ {"greek7", 64, 6},
+ {"ASMO_449", 65, 8},
+ {"iso-ir-90", 66, 9},
+ {"JIS_C6229-1984-a", 67, 16},
+ {"JIS_C6229-1984-b", 68, 16},
+ {"JIS_C6229-1984-b-add", 69, 20},
+ {"JIS_C6229-1984-hand", 70, 19},
+ {"JIS_C6229-1984-hand-add", 71, 23},
+ {"JIS_C6229-1984-kana", 72, 19},
+ {"ISO_2033-1983", 73, 13},
+ {"ANSI_X3.110-1983", 74, 16},
+ {"T.61-7bit", 75, 9},
+ {"T.61-8bit", 76, 9},
+ {"ECMA-cyrillic", 77, 13},
+ {"CSA_Z243.4-1985-1", 78, 17},
+ {"CSA_Z243.4-1985-2", 79, 17},
+ {"CSA_Z243.4-1985-gr", 80, 18},
+ {"ISO_8859-6-E", 81, 12},
+ {"ISO_8859-6-I", 82, 12},
+ {"T.101-G2", 83, 8},
+ {"ISO_8859-8-E", 84, 12},
+ {"ISO_8859-8-I", 85, 12},
+ {"CSN_369103", 86, 10},
+ {"JUS_I.B1.002", 87, 12},
+ {"IEC_P27-1", 88, 9},
+ {"JUS_I.B1.003-serb", 89, 17},
+ {"JUS_I.B1.003-mac", 90, 16},
+ {"greek-ccitt", 91, 11},
+ {"NC_NC00-10:81", 92, 13},
+ {"ISO_6937-2-25", 93, 13},
+ {"GOST_19768-74", 94, 13},
+ {"ISO_8859-supp", 95, 13},
+ {"ISO_10367-box", 96, 13},
+ {"latin-lap", 97, 9},
+ {"JIS_X0212-1990", 98, 14},
+ {"DS_2089", 99, 7},
+ {"us-dk", 100, 5},
+ {"dk-us", 101, 5},
+ {"KSC5636", 102, 7},
+ {"UNICODE-1-1-UTF-7", 103, 17},
+ {"ISO-2022-CN", 104, 11},
+ {"ISO-2022-CN-EXT", 105, 15},
+ {"UTF-8", 106, 5},
+ {"ISO-8859-13", 109, 11},
+ {"ISO-8859-14", 110, 11},
+ {"ISO-8859-15", 111, 11},
+ {"ISO-8859-16", 112, 11},
+ {"GBK", 113, 3},
+ {"GB18030", 114, 7},
+ {"OSD_EBCDIC_DF04_15", 115, 18},
+ {"OSD_EBCDIC_DF03_IRV", 116, 19},
+ {"OSD_EBCDIC_DF04_1", 117, 17},
+ {"ISO-11548-1", 118, 11},
+ {"KZ-1048", 119, 7},
+ {"ISO-10646-UCS-2", 1000, 15},
+ {"ISO-10646-UCS-4", 1001, 15},
+ {"ISO-10646-UCS-Basic", 1002, 19},
+ {"ISO-10646-Unicode-Latin1", 1003, 24},
+ {"ISO-10646-J-1", 1004, 13},
+ {"ISO-Unicode-IBM-1261", 1005, 20},
+ {"ISO-Unicode-IBM-1268", 1006, 20},
+ {"ISO-Unicode-IBM-1276", 1007, 20},
+ {"ISO-Unicode-IBM-1264", 1008, 20},
+ {"ISO-Unicode-IBM-1265", 1009, 20},
+ {"UNICODE-1-1", 1010, 11},
+ {"SCSU", 1011, 4},
+ {"UTF-7", 1012, 5},
+ {"UTF-16BE", 1013, 8},
+ {"UTF-16LE", 1014, 8},
+ {"UTF-16", 1015, 6},
+ {"CESU-8", 1016, 6},
+ {"UTF-32", 1017, 6},
+ {"UTF-32BE", 1018, 8},
+ {"UTF-32LE", 1019, 8},
+ {"BOCU-1", 1020, 6},
+ {"UTF-7-IMAP", 1021, 10},
+ {"ISO-8859-1-Windows-3.0-Latin-1", 2000, 30},
+ {"ISO-8859-1-Windows-3.1-Latin-1", 2001, 30},
+ {"ISO-8859-2-Windows-Latin-2", 2002, 26},
+ {"ISO-8859-9-Windows-Latin-5", 2003, 26},
+ {"hp-roman8", 2004, 9},
+ {"Adobe-Standard-Encoding", 2005, 23},
+ {"Ventura-US", 2006, 10},
+ {"Ventura-International", 2007, 21},
+ {"DEC-MCS", 2008, 7},
+ {"IBM850", 2009, 6},
+ {"IBM852", 2010, 6},
+ {"IBM437", 2011, 6},
+ {"PC8-Danish-Norwegian", 2012, 20},
+ {"IBM862", 2013, 6},
+ {"PC8-Turkish", 2014, 11},
+ {"IBM-Symbols", 2015, 11},
+ {"IBM-Thai", 2016, 8},
+ {"HP-Legal", 2017, 8},
+ {"HP-Pi-font", 2018, 10},
+ {"HP-Math8", 2019, 8},
+ {"Adobe-Symbol-Encoding", 2020, 21},
+ {"HP-DeskTop", 2021, 10},
+ {"Ventura-Math", 2022, 12},
+ {"Microsoft-Publishing", 2023, 20},
+ {"Windows-31J", 2024, 11},
+ {"GB2312", 2025, 6},
+ {"Big5", 2026, 4},
+ {"macintosh", 2027, 9},
+ {"IBM037", 2028, 6},
+ {"IBM038", 2029, 6},
+ {"IBM273", 2030, 6},
+ {"IBM274", 2031, 6},
+ {"IBM275", 2032, 6},
+ {"IBM277", 2033, 6},
+ {"IBM278", 2034, 6},
+ {"IBM280", 2035, 6},
+ {"IBM281", 2036, 6},
+ {"IBM284", 2037, 6},
+ {"IBM285", 2038, 6},
+ {"IBM290", 2039, 6},
+ {"IBM297", 2040, 6},
+ {"IBM420", 2041, 6},
+ {"IBM423", 2042, 6},
+ {"IBM424", 2043, 6},
+ {"IBM500", 2044, 6},
+ {"IBM851", 2045, 6},
+ {"IBM855", 2046, 6},
+ {"IBM857", 2047, 6},
+ {"IBM860", 2048, 6},
+ {"IBM861", 2049, 6},
+ {"IBM863", 2050, 6},
+ {"IBM864", 2051, 6},
+ {"IBM865", 2052, 6},
+ {"IBM868", 2053, 6},
+ {"IBM869", 2054, 6},
+ {"IBM870", 2055, 6},
+ {"IBM871", 2056, 6},
+ {"IBM880", 2057, 6},
+ {"IBM891", 2058, 6},
+ {"IBM903", 2059, 6},
+ {"IBM904", 2060, 6},
+ {"IBM905", 2061, 6},
+ {"IBM918", 2062, 6},
+ {"IBM1026", 2063, 7},
+ {"EBCDIC-AT-DE", 2064, 12},
+ {"EBCDIC-AT-DE-A", 2065, 14},
+ {"EBCDIC-CA-FR", 2066, 12},
+ {"EBCDIC-DK-NO", 2067, 12},
+ {"EBCDIC-DK-NO-A", 2068, 14},
+ {"EBCDIC-FI-SE", 2069, 12},
+ {"EBCDIC-FI-SE-A", 2070, 14},
+ {"EBCDIC-FR", 2071, 9},
+ {"EBCDIC-IT", 2072, 9},
+ {"EBCDIC-PT", 2073, 9},
+ {"EBCDIC-ES", 2074, 9},
+ {"EBCDIC-ES-A", 2075, 11},
+ {"EBCDIC-ES-S", 2076, 11},
+ {"EBCDIC-UK", 2077, 9},
+ {"EBCDIC-US", 2078, 9},
+ {"UNKNOWN-8BIT", 2079, 12},
+ {"MNEMONIC", 2080, 8},
+ {"MNEM", 2081, 4},
+ {"VISCII", 2082, 6},
+ {"VIQR", 2083, 4},
+ {"KOI8-R", 2084, 6},
+ {"HZ-GB-2312", 2085, 10},
+ {"IBM866", 2086, 6},
+ {"IBM775", 2087, 6},
+ {"KOI8-U", 2088, 6},
+ {"IBM00858", 2089, 8},
+ {"IBM00924", 2090, 8},
+ {"IBM01140", 2091, 8},
+ {"IBM01141", 2092, 8},
+ {"IBM01142", 2093, 8},
+ {"IBM01143", 2094, 8},
+ {"IBM01144", 2095, 8},
+ {"IBM01145", 2096, 8},
+ {"IBM01146", 2097, 8},
+ {"IBM01147", 2098, 8},
+ {"IBM01148", 2099, 8},
+ {"IBM01149", 2100, 8},
+ {"Big5-HKSCS", 2101, 10},
+ {"IBM1047", 2102, 7},
+ {"PTCP154", 2103, 7},
+ {"Amiga-1251", 2104, 10},
+ {"KOI7-switched", 2105, 13},
+ {"BRF", 2106, 3},
+ {"TSCII", 2107, 5},
+ {"CP51932", 2108, 7},
+ {"windows-874", 2109, 11},
+ {"windows-1250", 2250, 12},
+ {"windows-1251", 2251, 12},
+ {"windows-1252", 2252, 12},
+ {"windows-1253", 2253, 12},
+ {"windows-1254", 2254, 12},
+ {"windows-1255", 2255, 12},
+ {"windows-1256", 2256, 12},
+ {"windows-1257", 2257, 12},
+ {"windows-1258", 2258, 12},
+ {"TIS-620", 2259, 7},
+ {"CP50220", 2260, 7},
+};
-constexpr std::array<const encoding_pair, 256> unique_encoding_data{{
- {3, "ANSI_X3.4-1968"},
- {4, "ISO-8859-1"},
- {5, "ISO-8859-2"},
- {6, "ISO-8859-3"},
- {7, "ISO-8859-4"},
- {8, "ISO-8859-5"},
- {9, "ISO-8859-6"},
- {10, "ISO-8859-7"},
- {11, "ISO-8859-8"},
- {12, "ISO-8859-9"},
- {13, "ISO-8859-10"},
- {14, "ISO_6937-2-add"},
- {15, "JIS_X0201"},
- {16, "JIS_Encoding"},
- {17, "Shift_JIS"},
- {18, "EUC-JP"},
- {19, "Extended_UNIX_Code_Fixed_Width_for_Japanese"},
- {20, "BS_4730"},
- {21, "SEN_850200_C"},
- {22, "IT"},
- {23, "ES"},
- {24, "DIN_66003"},
- {25, "NS_4551-1"},
- {26, "NF_Z_62-010"},
- {27, "ISO-10646-UTF-1"},
- {28, "ISO_646.basic:1983"},
- {29, "INVARIANT"},
- {30, "ISO_646.irv:1983"},
- {31, "NATS-SEFI"},
- {32, "NATS-SEFI-ADD"},
- {35, "SEN_850200_B"},
- {36, "KS_C_5601-1987"},
- {37, "ISO-2022-KR"},
- {38, "EUC-KR"},
- {39, "ISO-2022-JP"},
- {40, "ISO-2022-JP-2"},
- {41, "JIS_C6220-1969-jp"},
- {42, "JIS_C6220-1969-ro"},
- {43, "PT"},
- {44, "greek7-old"},
- {45, "latin-greek"},
- {46, "NF_Z_62-010_(1973)"},
- {47, "Latin-greek-1"},
- {48, "ISO_5427"},
- {49, "JIS_C6226-1978"},
- {50, "BS_viewdata"},
- {51, "INIS"},
- {52, "INIS-8"},
- {53, "INIS-cyrillic"},
- {54, "ISO_5427:1981"},
- {55, "ISO_5428:1980"},
- {56, "GB_1988-80"},
- {57, "GB_2312-80"},
- {58, "NS_4551-2"},
- {59, "videotex-suppl"},
- {60, "PT2"},
- {61, "ES2"},
- {62, "MSZ_7795.3"},
- {63, "JIS_C6226-1983"},
- {64, "greek7"},
- {65, "ASMO_449"},
- {66, "iso-ir-90"},
- {67, "JIS_C6229-1984-a"},
- {68, "JIS_C6229-1984-b"},
- {69, "JIS_C6229-1984-b-add"},
- {70, "JIS_C6229-1984-hand"},
- {71, "JIS_C6229-1984-hand-add"},
- {72, "JIS_C6229-1984-kana"},
- {73, "ISO_2033-1983"},
- {74, "ANSI_X3.110-1983"},
- {75, "T.61-7bit"},
- {76, "T.61-8bit"},
- {77, "ECMA-cyrillic"},
- {78, "CSA_Z243.4-1985-1"},
- {79, "CSA_Z243.4-1985-2"},
- {80, "CSA_Z243.4-1985-gr"},
- {81, "ISO-8859-6-E"},
- {82, "ISO-8859-6-I"},
- {83, "T.101-G2"},
- {84, "ISO-8859-8-E"},
- {85, "ISO-8859-8-I"},
- {86, "CSN_369103"},
- {87, "JUS_I.B1.002"},
- {88, "IEC_P27-1"},
- {89, "JUS_I.B1.003-serb"},
- {90, "JUS_I.B1.003-mac"},
- {91, "greek-ccitt"},
- {92, "NC_NC00-10:81"},
- {93, "ISO_6937-2-25"},
- {94, "GOST_19768-74"},
- {95, "ISO_8859-supp"},
- {96, "ISO_10367-box"},
- {97, "latin-lap"},
- {98, "JIS_X0212-1990"},
- {99, "DS_2089"},
- {100, "us-dk"},
- {101, "dk-us"},
- {102, "KSC5636"},
- {103, "UNICODE-1-1-UTF-7"},
- {104, "ISO-2022-CN"},
- {105, "ISO-2022-CN-EXT"},
- {106, "UTF-8"},
- {109, "ISO-8859-13"},
- {110, "ISO-8859-14"},
- {111, "ISO-8859-15"},
- {112, "ISO-8859-16"},
- {113, "GBK"},
- {114, "GB18030"},
- {115, "OSD_EBCDIC_DF04_15"},
- {116, "OSD_EBCDIC_DF03_IRV"},
- {117, "OSD_EBCDIC_DF04_1"},
- {118, "ISO-11548-1"},
- {119, "KZ-1048"},
- {1000, "ISO-10646-UCS-2"},
- {1001, "ISO-10646-UCS-4"},
- {1002, "ISO-10646-UCS-Basic"},
- {1003, "ISO-10646-Unicode-Latin1"},
- {1004, "ISO-10646-J-1"},
- {1005, "ISO-Unicode-IBM-1261"},
- {1006, "ISO-Unicode-IBM-1268"},
- {1007, "ISO-Unicode-IBM-1276"},
- {1008, "ISO-Unicode-IBM-1264"},
- {1009, "ISO-Unicode-IBM-1265"},
- {1010, "UNICODE-1-1"},
- {1011, "SCSU"},
- {1012, "UTF-7"},
- {1013, "UTF-16BE"},
- {1014, "UTF-16LE"},
- {1015, "UTF-16"},
- {1016, "CESU-8"},
- {1017, "UTF-32"},
- {1018, "UTF-32BE"},
- {1019, "UTF-32LE"},
- {1020, "BOCU-1"},
- {1021, "UTF-7-IMAP"},
- {2000, "ISO-8859-1-Windows-3.0-Latin-1"},
- {2001, "ISO-8859-1-Windows-3.1-Latin-1"},
- {2002, "ISO-8859-2-Windows-Latin-2"},
- {2003, "ISO-8859-9-Windows-Latin-5"},
- {2004, "hp-roman8"},
- {2005, "Adobe-Standard-Encoding"},
- {2006, "Ventura-US"},
- {2007, "Ventura-International"},
- {2008, "DEC-MCS"},
- {2009, "IBM850"},
- {2010, "IBM852"},
- {2011, "IBM437"},
- {2012, "PC8-Danish-Norwegian"},
- {2013, "IBM862"},
- {2014, "PC8-Turkish"},
- {2015, "IBM-Symbols"},
- {2016, "IBM-Thai"},
- {2017, "HP-Legal"},
- {2018, "HP-Pi-font"},
- {2019, "HP-Math8"},
- {2020, "Adobe-Symbol-Encoding"},
- {2021, "HP-DeskTop"},
- {2022, "Ventura-Math"},
- {2023, "Microsoft-Publishing"},
- {2024, "Windows-31J"},
- {2025, "GB2312"},
- {2026, "Big5"},
- {2027, "macintosh"},
- {2028, "IBM037"},
- {2029, "IBM038"},
- {2030, "IBM273"},
- {2031, "IBM274"},
- {2032, "IBM275"},
- {2033, "IBM277"},
- {2034, "IBM278"},
- {2035, "IBM280"},
- {2036, "IBM281"},
- {2037, "IBM284"},
- {2038, "IBM285"},
- {2039, "IBM290"},
- {2040, "IBM297"},
- {2041, "IBM420"},
- {2042, "IBM423"},
- {2043, "IBM424"},
- {2044, "IBM500"},
- {2045, "IBM851"},
- {2046, "IBM855"},
- {2047, "IBM857"},
- {2048, "IBM860"},
- {2049, "IBM861"},
- {2050, "IBM863"},
- {2051, "IBM864"},
- {2052, "IBM865"},
- {2053, "IBM868"},
- {2054, "IBM869"},
- {2055, "IBM870"},
- {2056, "IBM871"},
- {2057, "IBM880"},
- {2058, "IBM891"},
- {2059, "IBM903"},
- {2060, "IBM904"},
- {2061, "IBM905"},
- {2062, "IBM918"},
- {2063, "IBM1026"},
- {2064, "EBCDIC-AT-DE"},
- {2065, "EBCDIC-AT-DE-A"},
- {2066, "EBCDIC-CA-FR"},
- {2067, "EBCDIC-DK-NO"},
- {2068, "EBCDIC-DK-NO-A"},
- {2069, "EBCDIC-FI-SE"},
- {2070, "EBCDIC-FI-SE-A"},
- {2071, "EBCDIC-FR"},
- {2072, "EBCDIC-IT"},
- {2073, "EBCDIC-PT"},
- {2074, "EBCDIC-ES"},
- {2075, "EBCDIC-ES-A"},
- {2076, "EBCDIC-ES-S"},
- {2077, "EBCDIC-UK"},
- {2078, "EBCDIC-US"},
- {2079, "UNKNOWN-8BIT"},
- {2080, "MNEMONIC"},
- {2081, "MNEM"},
- {2082, "VISCII"},
- {2083, "VIQR"},
- {2084, "KOI8-R"},
- {2085, "HZ-GB-2312"},
- {2086, "IBM866"},
- {2087, "IBM775"},
- {2088, "KOI8-U"},
- {2089, "IBM00858"},
- {2090, "IBM00924"},
- {2091, "IBM01140"},
- {2092, "IBM01141"},
- {2093, "IBM01142"},
- {2094, "IBM01143"},
- {2095, "IBM01144"},
- {2096, "IBM01145"},
- {2097, "IBM01146"},
- {2098, "IBM01147"},
- {2099, "IBM01148"},
- {2100, "IBM01149"},
- {2101, "Big5-HKSCS"},
- {2102, "IBM1047"},
- {2103, "PTCP154"},
- {2104, "Amiga-1251"},
- {2105, "KOI7-switched"},
- {2106, "BRF"},
- {2107, "TSCII"},
- {2108, "CP51932"},
- {2109, "windows-874"},
- {2250, "windows-1250"},
- {2251, "windows-1251"},
- {2252, "windows-1252"},
- {2253, "windows-1253"},
- {2254, "windows-1254"},
- {2255, "windows-1255"},
- {2256, "windows-1256"},
- {2257, "windows-1257"},
- {2258, "windows-1258"},
- {2259, "TIS-620"},
- {2260, "CP50220"},
-}};
+constexpr const char* other_names[]{
+ "graah", "oops", "libcxx", "foobar", "barbaz", "1234567", "llvm-project", "utf-81", "utf-9", "CA-ASCII"};
inline bool checkTextEncoding(std::text_encoding te1, std::text_encoding te2) {
+ int success = true;
+
if (te1 != te2) {
- std::println(
- std::cerr,
- "Text encoding mismatch! [{}] {} vs [{}] {}",
- int(te1.mib()),
- te1.name(),
- int(te2.mib()),
- te2.name());
- return false;
+ success = false;
}
if (te1.mib() != te2) {
- std::println(std::cerr, "text encoding id mismatch! {} vs {}", int(te1.mib()), int(te2.mib()));
+ success = false;
}
if (std::string_view(te1.name()) != std::string_view(te2.name())) {
- std::println(std::cerr, "text encoding name mismatch! {} vs {}", te1.name(), te2.name());
+ success = false;
+ }
+
+ if (!success) {
+ std::println(
+ stderr, "Text encoding mismatch! [{}] {} vs [{}] {}", int(te1.mib()), te1.name(), int(te2.mib()), te2.name());
}
return true;
}
>From b8b76d54a39dac6c06ad12e9e7a73f445bb29578 Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Sun, 13 Jul 2025 14:38:21 -0400
Subject: [PATCH 5/9] Update ABI list
---
...rpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist | 2 +-
...c64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist | 2 +-
...n-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist | 2 +-
...linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist | 6 +++---
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
index 47c87e5439a5a..779fcdca221a5 100644
--- a/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/powerpc-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -550,12 +550,12 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD0Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD2Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
+{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__119__text_encoding_rep21__get_locale_encodingEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__119__thread_local_dataEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__get_collation_nameEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEEi', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvi', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
diff --git a/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
index 5521b4a605bfb..3328aa93aee54 100644
--- a/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/powerpc64-ibm-aix.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -550,12 +550,12 @@
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD0Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD1Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD2Ev', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
+{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__119__text_encoding_rep21__get_locale_encodingEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__119__thread_local_dataEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__get_collation_nameEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIlNS_22__cxx_atomic_base_implIlEEEEl', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvl', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
-{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
{'import_export': 'EXP', 'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'storage_mapping_class': 'DS', 'type': 'FUNC'}
diff --git a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
index b615c89932668..28eafb9ddc073 100644
--- a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -1214,7 +1214,7 @@
{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEEi', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvi', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__text_encoding_rep21__get_locale_encodingEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'type': 'FUNC'}
diff --git a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist
index f38e0b2e6dfb6..4b224ed76e3d1 100644
--- a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist
+++ b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist
@@ -196,6 +196,7 @@
{'is_defined': True, 'name': '_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNKSt3__115error_condition7messageEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117bad_function_call4whatEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv', 'type': 'FUNC'}
@@ -744,6 +745,7 @@
{'is_defined': True, 'name': '_ZNSt3__112system_errorD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__112system_errorD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__112system_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113__hash_memoryEPKvm', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE11__read_modeEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE12__write_modeEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4openEPKcj', 'type': 'FUNC'}
@@ -923,7 +925,6 @@
{'is_defined': True, 'name': '_ZNSt3__113random_deviceclEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED2Ev', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__113__hash_memoryEPKvm', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvEaSERKS1_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__114__num_get_base5__srcE', 'size': 33, 'type': 'OBJECT'}
@@ -1127,7 +1128,6 @@
{'is_defined': True, 'name': '_ZNSt3__117bad_function_callD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__117bad_function_callD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__117bad_function_callD2Ev', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNKSt3__117bad_function_call4whatEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__117iostream_categoryEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc', 'type': 'FUNC'}
@@ -1178,6 +1178,7 @@
{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__text_encoding_rep21__get_locale_encodingEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__119__thread_local_dataEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
@@ -1185,7 +1186,6 @@
{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKNS_17__cxx_atomic_implIiNS_22__cxx_atomic_base_implIiEEEEi', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__120__libcpp_atomic_waitEPVKvi', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'type': 'FUNC'}
-{'is_defined': True, 'name': '_ZNSt3__121__get_locale_encodingEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'type': 'FUNC'}
>From 98bb1c190e12d4a471b6ec13defc1bf11d3be8b2 Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Sun, 13 Jul 2025 16:04:49 -0400
Subject: [PATCH 6/9] Remove text_encoding forward declaration in
text_encoding_rep.h
---
libcxx/include/__text_encoding/text_encoding_rep.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/libcxx/include/__text_encoding/text_encoding_rep.h b/libcxx/include/__text_encoding/text_encoding_rep.h
index e6cd45c1db435..09fec29b916d7 100644
--- a/libcxx/include/__text_encoding/text_encoding_rep.h
+++ b/libcxx/include/__text_encoding/text_encoding_rep.h
@@ -37,7 +37,6 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
struct __text_encoding_rep;
-struct text_encoding;
struct __text_encoding_rep {
static constexpr size_t __max_name_length_ = 63;
>From 2bab717d1d59b3c406e3f20de57e0a879db0f903 Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Sun, 13 Jul 2025 20:28:49 -0400
Subject: [PATCH 7/9] Fix Windows implementation
---
libcxx/include/__text_encoding/text_encoding_rep.h | 6 ++++++
libcxx/src/text_encoding.cpp | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libcxx/include/__text_encoding/text_encoding_rep.h b/libcxx/include/__text_encoding/text_encoding_rep.h
index 09fec29b916d7..fb4b909ebac0a 100644
--- a/libcxx/include/__text_encoding/text_encoding_rep.h
+++ b/libcxx/include/__text_encoding/text_encoding_rep.h
@@ -335,6 +335,12 @@ struct __text_encoding_rep {
private:
_LIBCPP_HIDE_FROM_ABI constexpr __text_encoding_rep() = default;
+ _LIBCPP_HIDE_FROM_ABI constexpr text_encoding_rep(__id __i) noexcept
+ : __encoding_rep_(__find_encoding_data_by_id(__i)) {
+ if (__encoding_rep_->__name_[0] != '\0')
+ std::copy_n(__encoding_rep_->__name_, std::char_traits<char>::length(__encoding_rep_->__name_), __name_);
+ }
+
_LIBCPP_HIDE_FROM_ABI constexpr explicit __text_encoding_rep(string_view __enc) noexcept
: __encoding_rep_(__find_encoding_data(__enc)) {
__enc.copy(__name_, __max_name_length_, 0);
diff --git a/libcxx/src/text_encoding.cpp b/libcxx/src/text_encoding.cpp
index 8fc999b9196ec..520fe8c0f9cf4 100644
--- a/libcxx/src/text_encoding.cpp
+++ b/libcxx/src/text_encoding.cpp
@@ -69,9 +69,6 @@ __text_encoding_rep __text_encoding_rep::__get_locale_encoding(const char* __nam
case 865:
__mib = __text_encoding_rep::__id::IBM865;
break;
- case 865:
- __mib = __text_encoding_rep::__id::IBM865;
- break;
case 866:
__mib = __text_encoding_rep::__id::IBM866;
break;
@@ -123,9 +120,6 @@ __text_encoding_rep __text_encoding_rep::__get_locale_encoding(const char* __nam
case 1146:
__mib = __text_encoding_rep::__id::IBM01146;
break;
- case 1146:
- __mib = __text_encoding_rep::__id::IBM01146;
- break;
case 1147:
__mib = __text_encoding_rep::__id::IBM01147;
break;
>From dcc20608539c7712a9b412702f3c48bda9183275 Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Sun, 13 Jul 2025 20:36:28 -0400
Subject: [PATCH 8/9] Add symbol to Apple ABI list
---
...4-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
index 162757c7e37ec..c63d890a77202 100644
--- a/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
+++ b/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist
@@ -1559,6 +1559,7 @@
{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD0Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD1Ev', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '__ZNSt3__119__text_encoding_rep21__get_locale_encodingEPKc', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__119__thread_local_dataEv', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
{'is_defined': True, 'name': '__ZNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEOS5_', 'type': 'FUNC'}
@@ -2649,4 +2650,4 @@
{'is_defined': True, 'name': '___cxa_vec_new2', 'type': 'I'}
{'is_defined': True, 'name': '___cxa_vec_new3', 'type': 'I'}
{'is_defined': True, 'name': '___dynamic_cast', 'type': 'I'}
-{'is_defined': True, 'name': '___gxx_personality_v0', 'type': 'I'}
\ No newline at end of file
+{'is_defined': True, 'name': '___gxx_personality_v0', 'type': 'I'}
>From d23f8abdba2aa2e2593337541bcd553ea8c71796 Mon Sep 17 00:00:00 2001
From: William Tran-Viet <wtranviet at proton.me>
Date: Sun, 13 Jul 2025 20:46:25 -0400
Subject: [PATCH 9/9] Remove top-level <langinfo.h> include
---
libcxx/include/__locale_dir/locale_base_api.h | 8 --------
1 file changed, 8 deletions(-)
diff --git a/libcxx/include/__locale_dir/locale_base_api.h b/libcxx/include/__locale_dir/locale_base_api.h
index f9945fac29af3..8006c394ebeff 100644
--- a/libcxx/include/__locale_dir/locale_base_api.h
+++ b/libcxx/include/__locale_dir/locale_base_api.h
@@ -147,9 +147,6 @@
# if _LIBCPP_HAS_WIDE_CHARACTERS
# include <wctype.h>
# endif
-# if __has_include(<langinfo.h>)
-# include <langinfo.h>
-# endif
_LIBCPP_BEGIN_NAMESPACE_STD
namespace __locale {
//
@@ -181,11 +178,6 @@ inline _LIBCPP_HIDE_FROM_ABI void __freelocale(__locale_t __loc) { freelocale(__
inline _LIBCPP_HIDE_FROM_ABI __lconv_t* __localeconv(__locale_t& __loc) { return __libcpp_localeconv_l(__loc); }
-# if __has_include(<langinfo.h>)
-inline _LIBCPP_HIDE_FROM_ABI char* __nl_langinfo_l(int __category_mask, __locale_t __l) {
- return ::nl_langinfo_l(__category_mask, __l);
-}
-# endif
# endif // _LIBCPP_BUILDING_LIBRARY
//
More information about the libcxx-commits
mailing list