From Jason Turner

[text.encoding.class]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp67e13wtf/{from.md → to.md} +565 -0
tmp/tmp67e13wtf/{from.md → to.md} RENAMED
@@ -0,0 +1,565 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Class `text_encoding` <a id="text.encoding.class">[[text.encoding.class]]</a>
2
+
3
+ #### Overview <a id="text.encoding.overview">[[text.encoding.overview]]</a>
4
+
5
+ The class `text_encoding` describes an interface for accessing the IANA
6
+ Character Sets registry.
7
+
8
+ ``` cpp
9
+ namespace std {
10
+ struct text_encoding {
11
+ static constexpr size_t max_name_length = 63;
12
+
13
+ // [text.encoding.id], enumeration text_encoding::id
14
+ enum class id : int_least32_t {
15
+ see below
16
+ };
17
+ using enum id;
18
+
19
+ constexpr text_encoding() = default;
20
+ constexpr explicit text_encoding(string_view enc) noexcept;
21
+ constexpr text_encoding(id i) noexcept;
22
+
23
+ constexpr id mib() const noexcept;
24
+ constexpr const char* name() const noexcept;
25
+
26
+ // [text.encoding.aliases], class text_encoding::aliases_view
27
+ struct aliases_view;
28
+ constexpr aliases_view aliases() const noexcept;
29
+
30
+ friend constexpr bool operator==(const text_encoding& a,
31
+ const text_encoding& b) noexcept;
32
+ friend constexpr bool operator==(const text_encoding& encoding, id i) noexcept;
33
+
34
+ static consteval text_encoding literal() noexcept;
35
+ static text_encoding environment();
36
+ template<id i> static bool environment_is();
37
+
38
+ private:
39
+ id mib_ = id::unknown; // exposition only
40
+ char name_[max_name_length + 1] = {0}; // exposition only
41
+ static constexpr bool comp-name(string_view a, string_view b); // exposition only
42
+ };
43
+ }
44
+ ```
45
+
46
+ Class `text_encoding` is a trivially copyable type
47
+ [[term.trivially.copyable.type]].
48
+
49
+ #### General <a id="text.encoding.general">[[text.encoding.general]]</a>
50
+
51
+ A *registered character encoding* is a character encoding scheme in the
52
+ IANA Character Sets registry.
53
+
54
+ [*Note 1*: The IANA Character Sets registry uses the term “character
55
+ sets” to refer to character encodings. — *end note*]
56
+
57
+ The primary name of a registered character encoding is the name of that
58
+ encoding specified in the IANA Character Sets registry.
59
+
60
+ The set of known registered character encodings contains every
61
+ registered character encoding specified in the IANA Character Sets
62
+ registry except for the following:
63
+
64
+ - NATS-DANO (33)
65
+ - NATS-DANO-ADD (34)
66
+
67
+ Each known registered character encoding is identified by an enumerator
68
+ in `text_encoding::id`, and has a set of zero or more *aliases*.
69
+
70
+ The set of aliases of a known registered character encoding is an
71
+ *implementation-defined* superset of the aliases specified in the IANA
72
+ Character Sets registry. The set of aliases for US-ASCII includes
73
+ “ASCII”. No two aliases or primary names of distinct registered
74
+ character encodings are equivalent when compared by
75
+ `text_encoding::comp-name`.
76
+
77
+ How a `text_encoding` object is determined to be representative of a
78
+ character encoding scheme implemented in the translation or execution
79
+ environment is *implementation-defined*.
80
+
81
+ An object `e` of type `text_encoding` such that
82
+ `e.mib() == text_encoding::id::unknown` is `false` and
83
+ `e.mib() == text_encoding::id::other` is `false` maintains the following
84
+ invariants:
85
+
86
+ - `*e.name() == '\0'` is `false`, and
87
+ - `e.mib() == text_encoding(e.name()).mib()` is `true`.
88
+
89
+ *Recommended practice:*
90
+
91
+ - Implementations should not consider registered encodings to be
92
+ interchangeable. \[*Example 1*: Shift_JIS and Windows-31J denote
93
+ different encodings. — *end example*]
94
+ - Implementations should not use the name of a registered encoding to
95
+ describe another similar yet different non-registered encoding unless
96
+ there is a precedent on that implementation.
97
+ \[*Example 2*: Big5 — *end example*]
98
+
99
+ #### Members <a id="text.encoding.members">[[text.encoding.members]]</a>
100
+
101
+ ``` cpp
102
+ constexpr explicit text_encoding(string_view enc) noexcept;
103
+ ```
104
+
105
+ *Preconditions:*
106
+
107
+ - `enc` represents a string in the ordinary literal encoding consisting
108
+ only of elements of the basic character set [[lex.charset]].
109
+ - `enc.size() <= max_name_length` is `true`.
110
+ - `enc.contains(’\0’)` is `false`.
111
+
112
+ *Ensures:*
113
+
114
+ - If there exists a primary name or alias `a` of a known registered
115
+ character encoding such that *`comp-name`*`(a, enc)` is `true`,
116
+ *mib\_* has the value of the enumerator of `id` associated with that
117
+ registered character encoding. Otherwise, *`mib_`*` == id::other` is
118
+ `true`.
119
+ - `enc.compare(`*`name_`*`) == 0` is `true`.
120
+
121
+ ``` cpp
122
+ constexpr text_encoding(id i) noexcept;
123
+ ```
124
+
125
+ *Preconditions:* `i` has the value of one of the enumerators of `id`.
126
+
127
+ *Ensures:*
128
+
129
+ - *`mib_`*` == i` is `true`.
130
+ - If `(`*`mib_`*` == id::unknown || `*`mib_`*` == id::other)` is `true`,
131
+ `strlen(`*`name_`*`) == 0` is `true`. Otherwise,
132
+ `ranges::contains(aliases(), string_view(`*`name_`*`))` is `true`.
133
+
134
+ ``` cpp
135
+ constexpr id mib() const noexcept;
136
+ ```
137
+
138
+ *Returns:* *mib\_*.
139
+
140
+ ``` cpp
141
+ constexpr const char* name() const noexcept;
142
+ ```
143
+
144
+ *Returns:* *name\_*.
145
+
146
+ *Remarks:* `name()` is an NTBS and accessing elements of *name\_*
147
+ outside of the range `name()`+\[0, `strlen(name()) + 1`) is undefined
148
+ behavior.
149
+
150
+ ``` cpp
151
+ constexpr aliases_view aliases() const noexcept;
152
+ ```
153
+
154
+ Let `r` denote an instance of `aliases_view`. If `*this` represents a
155
+ known registered character encoding, then:
156
+
157
+ - `r.front()` is the primary name of the registered character encoding,
158
+ - `r` contains the aliases of the registered character encoding, and
159
+ - `r` does not contain duplicate values when compared with `strcmp`.
160
+
161
+ Otherwise, `r` is an empty range.
162
+
163
+ Each element in `r` is a non-null, non-empty NTBS encoded in the literal
164
+ character encoding and comprising only characters from the basic
165
+ character set.
166
+
167
+ *Returns:* `r`.
168
+
169
+ [*Note 1*: The order of aliases in `r` is unspecified. — *end note*]
170
+
171
+ ``` cpp
172
+ static consteval text_encoding literal() noexcept;
173
+ ```
174
+
175
+ *Mandates:* `CHAR_BIT == 8` is `true`.
176
+
177
+ *Returns:* A `text_encoding` object representing the ordinary character
178
+ literal encoding [[lex.charset]].
179
+
180
+ ``` cpp
181
+ static text_encoding environment();
182
+ ```
183
+
184
+ *Mandates:* `CHAR_BIT == 8` is `true`.
185
+
186
+ *Returns:* A `text_encoding` object representing the
187
+ *implementation-defined* character encoding scheme of the environment.
188
+ On a POSIX implementation, this is the encoding scheme associated with
189
+ the POSIX locale denoted by the empty string `""`.
190
+
191
+ [*Note 2*: This function is not affected by calls to
192
+ `setlocale`. — *end note*]
193
+
194
+ *Recommended practice:* Implementations should return a value that is
195
+ not affected by calls to the POSIX function `setenv` and other functions
196
+ which can modify the environment [[support.runtime]].
197
+
198
+ ``` cpp
199
+ template<id i>
200
+ static bool environment_is();
201
+ ```
202
+
203
+ *Mandates:* `CHAR_BIT == 8` is `true`.
204
+
205
+ *Returns:* `environment() == i`.
206
+
207
+ ``` cpp
208
+ static constexpr bool comp-name(string_view a, string_view b);
209
+ ```
210
+
211
+ *Returns:* `true` if the two strings `a` and `b` encoded in the ordinary
212
+ literal encoding are equal, ignoring, from left-to-right,
213
+
214
+ - all elements that are not digits or letters [[character.seq.general]],
215
+ - character case, and
216
+ - any sequence of one or more `0` characters not immediately preceded by
217
+ a numeric prefix, where a numeric prefix is a sequence consisting of a
218
+ digit in the range \[`1`, `9`\] optionally followed by one or more
219
+ elements which are not digits or letters,
220
+
221
+ and `false` otherwise.
222
+
223
+ [*Note 3*: This comparison is identical to the “Charset Alias Matching”
224
+ algorithm described in the Unicode Technical Standard 22. — *end note*]
225
+
226
+ [*Example 1*:
227
+
228
+ ``` cpp
229
+ static_assert(comp-name("UTF-8", "utf8") == true);
230
+ static_assert(comp-name("u.t.f-008", "utf8") == true);
231
+ static_assert(comp-name("ut8", "utf8") == false);
232
+ static_assert(comp-name("utf-80", "utf8") == false);
233
+ ```
234
+
235
+ — *end example*]
236
+
237
+ #### Comparison functions <a id="text.encoding.cmp">[[text.encoding.cmp]]</a>
238
+
239
+ ``` cpp
240
+ friend constexpr bool operator==(const text_encoding& a, const text_encoding& b) noexcept;
241
+ ```
242
+
243
+ *Returns:* If `a.`*`mib_`*` == id::other && b.`*`mib_`*` == id::other`
244
+ is `true`, then *`comp-name`*`(a.`*`name_`*`,b.`*`name_`*`)`. Otherwise,
245
+ `a.`*`mib_`*` == b.`*`mib_`*.
246
+
247
+ ``` cpp
248
+ friend constexpr bool operator==(const text_encoding& encoding, id i) noexcept;
249
+ ```
250
+
251
+ *Returns:* `encoding.`*`mib_`*` == i`.
252
+
253
+ *Remarks:* This operator induces an equivalence relation on its
254
+ arguments if and only if `i != id::other` is `true`.
255
+
256
+ #### Class `text_encoding::aliases_view` <a id="text.encoding.aliases">[[text.encoding.aliases]]</a>
257
+
258
+ ``` cpp
259
+ struct text_encoding::aliases_view : ranges::view_interface<text_encoding::aliases_view> {
260
+ constexpr implementation-defined // type of text_encoding::aliases_view::begin() begin() const;
261
+ constexpr implementation-defined // type of text_encoding::aliases_view::end() end() const;
262
+ };
263
+ ```
264
+
265
+ `text_encoding::aliases_view` models `copyable`, `ranges::view`,
266
+ `ranges::random_access_range`, and `ranges::borrowed_range`.
267
+
268
+ [*Note 1*: `text_encoding::aliases_view` is not required to satisfy
269
+ `ranges::``common_range`, nor `default_initializable`. — *end note*]
270
+
271
+ Both `ranges::range_value_t<text_encoding::aliases_view>` and
272
+ `ranges::range_reference_t<text_encoding::aliases_view>` denote
273
+ `const char*`.
274
+
275
+ `ranges::iterator_t<text_encoding::aliases_view>` is a constexpr
276
+ iterator [[iterator.requirements.general]].
277
+
278
+ #### Enumeration `text_encoding::id` <a id="text.encoding.id">[[text.encoding.id]]</a>
279
+
280
+ ``` cpp
281
+ namespace std {
282
+ enum class text_encoding::id : int_least32_t {
283
+ other = 1,
284
+ unknown = 2,
285
+ ASCII = 3,
286
+ ISOLatin1 = 4,
287
+ ISOLatin2 = 5,
288
+ ISOLatin3 = 6,
289
+ ISOLatin4 = 7,
290
+ ISOLatinCyrillic = 8,
291
+ ISOLatinArabic = 9,
292
+ ISOLatinGreek = 10,
293
+ ISOLatinHebrew = 11,
294
+ ISOLatin5 = 12,
295
+ ISOLatin6 = 13,
296
+ ISOTextComm = 14,
297
+ HalfWidthKatakana = 15,
298
+ JISEncoding = 16,
299
+ ShiftJIS = 17,
300
+ EUCPkdFmtJapanese = 18,
301
+ EUCFixWidJapanese = 19,
302
+ ISO4UnitedKingdom = 20,
303
+ ISO11SwedishForNames = 21,
304
+ ISO15Italian = 22,
305
+ ISO17Spanish = 23,
306
+ ISO21German = 24,
307
+ ISO60DanishNorwegian = 25,
308
+ ISO69French = 26,
309
+ ISO10646UTF1 = 27,
310
+ ISO646basic1983 = 28,
311
+ INVARIANT = 29,
312
+ ISO2IntlRefVersion = 30,
313
+ NATSSEFI = 31,
314
+ NATSSEFIADD = 32,
315
+ ISO10Swedish = 35,
316
+ KSC56011987 = 36,
317
+ ISO2022KR = 37,
318
+ EUCKR = 38,
319
+ ISO2022JP = 39,
320
+ ISO2022JP2 = 40,
321
+ ISO13JISC6220jp = 41,
322
+ ISO14JISC6220ro = 42,
323
+ ISO16Portuguese = 43,
324
+ ISO18Greek7Old = 44,
325
+ ISO19LatinGreek = 45,
326
+ ISO25French = 46,
327
+ ISO27LatinGreek1 = 47,
328
+ ISO5427Cyrillic = 48,
329
+ ISO42JISC62261978 = 49,
330
+ ISO47BSViewdata = 50,
331
+ ISO49INIS = 51,
332
+ ISO50INIS8 = 52,
333
+ ISO51INISCyrillic = 53,
334
+ ISO54271981 = 54,
335
+ ISO5428Greek = 55,
336
+ ISO57GB1988 = 56,
337
+ ISO58GB231280 = 57,
338
+ ISO61Norwegian2 = 58,
339
+ ISO70VideotexSupp1 = 59,
340
+ ISO84Portuguese2 = 60,
341
+ ISO85Spanish2 = 61,
342
+ ISO86Hungarian = 62,
343
+ ISO87JISX0208 = 63,
344
+ ISO88Greek7 = 64,
345
+ ISO89ASMO449 = 65,
346
+ ISO90 = 66,
347
+ ISO91JISC62291984a = 67,
348
+ ISO92JISC62991984b = 68,
349
+ ISO93JIS62291984badd = 69,
350
+ ISO94JIS62291984hand = 70,
351
+ ISO95JIS62291984handadd = 71,
352
+ ISO96JISC62291984kana = 72,
353
+ ISO2033 = 73,
354
+ ISO99NAPLPS = 74,
355
+ ISO102T617bit = 75,
356
+ ISO103T618bit = 76,
357
+ ISO111ECMACyrillic = 77,
358
+ ISO121Canadian1 = 78,
359
+ ISO122Canadian2 = 79,
360
+ ISO123CSAZ24341985gr = 80,
361
+ ISO88596E = 81,
362
+ ISO88596I = 82,
363
+ ISO128T101G2 = 83,
364
+ ISO88598E = 84,
365
+ ISO88598I = 85,
366
+ ISO139CSN369103 = 86,
367
+ ISO141JUSIB1002 = 87,
368
+ ISO143IECP271 = 88,
369
+ ISO146Serbian = 89,
370
+ ISO147Macedonian = 90,
371
+ ISO150 = 91,
372
+ ISO151Cuba = 92,
373
+ ISO6937Add = 93,
374
+ ISO153GOST1976874 = 94,
375
+ ISO8859Supp = 95,
376
+ ISO10367Box = 96,
377
+ ISO158Lap = 97,
378
+ ISO159JISX02121990 = 98,
379
+ ISO646Danish = 99,
380
+ USDK = 100,
381
+ DKUS = 101,
382
+ KSC5636 = 102,
383
+ Unicode11UTF7 = 103,
384
+ ISO2022CN = 104,
385
+ ISO2022CNEXT = 105,
386
+ UTF8 = 106,
387
+ ISO885913 = 109,
388
+ ISO885914 = 110,
389
+ ISO885915 = 111,
390
+ ISO885916 = 112,
391
+ GBK = 113,
392
+ GB18030 = 114,
393
+ OSDEBCDICDF0415 = 115,
394
+ OSDEBCDICDF03IRV = 116,
395
+ OSDEBCDICDF041 = 117,
396
+ ISO115481 = 118,
397
+ KZ1048 = 119,
398
+ UCS2 = 1000,
399
+ UCS4 = 1001,
400
+ UnicodeASCII = 1002,
401
+ UnicodeLatin1 = 1003,
402
+ UnicodeJapanese = 1004,
403
+ UnicodeIBM1261 = 1005,
404
+ UnicodeIBM1268 = 1006,
405
+ UnicodeIBM1276 = 1007,
406
+ UnicodeIBM1264 = 1008,
407
+ UnicodeIBM1265 = 1009,
408
+ Unicode11 = 1010,
409
+ SCSU = 1011,
410
+ UTF7 = 1012,
411
+ UTF16BE = 1013,
412
+ UTF16LE = 1014,
413
+ UTF16 = 1015,
414
+ CESU8 = 1016,
415
+ UTF32 = 1017,
416
+ UTF32BE = 1018,
417
+ UTF32LE = 1019,
418
+ BOCU1 = 1020,
419
+ UTF7IMAP = 1021,
420
+ Windows30Latin1 = 2000,
421
+ Windows31Latin1 = 2001,
422
+ Windows31Latin2 = 2002,
423
+ Windows31Latin5 = 2003,
424
+ HPRoman8 = 2004,
425
+ AdobeStandardEncoding = 2005,
426
+ VenturaUS = 2006,
427
+ VenturaInternational = 2007,
428
+ DECMCS = 2008,
429
+ PC850Multilingual = 2009,
430
+ PCp852 = 2010,
431
+ PC8CodePage437 = 2011,
432
+ PC8DanishNorwegian = 2012,
433
+ PC862LatinHebrew = 2013,
434
+ PC8Turkish = 2014,
435
+ IBMSymbols = 2015,
436
+ IBMThai = 2016,
437
+ HPLegal = 2017,
438
+ HPPiFont = 2018,
439
+ HPMath8 = 2019,
440
+ HPPSMath = 2020,
441
+ HPDesktop = 2021,
442
+ VenturaMath = 2022,
443
+ MicrosoftPublishing = 2023,
444
+ Windows31J = 2024,
445
+ GB2312 = 2025,
446
+ Big5 = 2026,
447
+ Macintosh = 2027,
448
+ IBM037 = 2028,
449
+ IBM038 = 2029,
450
+ IBM273 = 2030,
451
+ IBM274 = 2031,
452
+ IBM275 = 2032,
453
+ IBM277 = 2033,
454
+ IBM278 = 2034,
455
+ IBM280 = 2035,
456
+ IBM281 = 2036,
457
+ IBM284 = 2037,
458
+ IBM285 = 2038,
459
+ IBM290 = 2039,
460
+ IBM297 = 2040,
461
+ IBM420 = 2041,
462
+ IBM423 = 2042,
463
+ IBM424 = 2043,
464
+ IBM500 = 2044,
465
+ IBM851 = 2045,
466
+ IBM855 = 2046,
467
+ IBM857 = 2047,
468
+ IBM860 = 2048,
469
+ IBM861 = 2049,
470
+ IBM863 = 2050,
471
+ IBM864 = 2051,
472
+ IBM865 = 2052,
473
+ IBM868 = 2053,
474
+ IBM869 = 2054,
475
+ IBM870 = 2055,
476
+ IBM871 = 2056,
477
+ IBM880 = 2057,
478
+ IBM891 = 2058,
479
+ IBM903 = 2059,
480
+ IBM904 = 2060,
481
+ IBM905 = 2061,
482
+ IBM918 = 2062,
483
+ IBM1026 = 2063,
484
+ IBMEBCDICATDE = 2064,
485
+ EBCDICATDEA = 2065,
486
+ EBCDICCAFR = 2066,
487
+ EBCDICDKNO = 2067,
488
+ EBCDICDKNOA = 2068,
489
+ EBCDICFISE = 2069,
490
+ EBCDICFISEA = 2070,
491
+ EBCDICFR = 2071,
492
+ EBCDICIT = 2072,
493
+ EBCDICPT = 2073,
494
+ EBCDICES = 2074,
495
+ EBCDICESA = 2075,
496
+ EBCDICESS = 2076,
497
+ EBCDICUK = 2077,
498
+ EBCDICUS = 2078,
499
+ Unknown8BiT = 2079,
500
+ Mnemonic = 2080,
501
+ Mnem = 2081,
502
+ VISCII = 2082,
503
+ VIQR = 2083,
504
+ KOI8R = 2084,
505
+ HZGB2312 = 2085,
506
+ IBM866 = 2086,
507
+ PC775Baltic = 2087,
508
+ KOI8U = 2088,
509
+ IBM00858 = 2089,
510
+ IBM00924 = 2090,
511
+ IBM01140 = 2091,
512
+ IBM01141 = 2092,
513
+ IBM01142 = 2093,
514
+ IBM01143 = 2094,
515
+ IBM01144 = 2095,
516
+ IBM01145 = 2096,
517
+ IBM01146 = 2097,
518
+ IBM01147 = 2098,
519
+ IBM01148 = 2099,
520
+ IBM01149 = 2100,
521
+ Big5HKSCS = 2101,
522
+ IBM1047 = 2102,
523
+ PTCP154 = 2103,
524
+ Amiga1251 = 2104,
525
+ KOI7switched = 2105,
526
+ BRF = 2106,
527
+ TSCII = 2107,
528
+ CP51932 = 2108,
529
+ windows874 = 2109,
530
+ windows1250 = 2250,
531
+ windows1251 = 2251,
532
+ windows1252 = 2252,
533
+ windows1253 = 2253,
534
+ windows1254 = 2254,
535
+ windows1255 = 2255,
536
+ windows1256 = 2256,
537
+ windows1257 = 2257,
538
+ windows1258 = 2258,
539
+ TIS620 = 2259,
540
+ CP50220 = 2260
541
+ };
542
+ }
543
+ ```
544
+
545
+ [*Note 1*:
546
+
547
+ The `text_encoding::id` enumeration contains an enumerator for each
548
+ known registered character encoding. For each encoding, the
549
+ corresponding enumerator is derived from the alias beginning with
550
+ “`cs`”, as follows
551
+
552
+ - `csUnicode` is mapped to `text_encoding::id::UCS2`,
553
+ - `csIBBM904` is mapped to `text_encoding::id::IBM904`, and
554
+ - the “`cs`” prefix is removed from other names.
555
+
556
+ — *end note*]
557
+
558
+ #### Hash support <a id="text.encoding.hash">[[text.encoding.hash]]</a>
559
+
560
+ ``` cpp
561
+ template<> struct hash<text_encoding>;
562
+ ```
563
+
564
+ The specialization is enabled [[unord.hash]].
565
+