From Jason Turner

[depr.locale.stdcvt]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpx7e88b97/{from.md → to.md} +87 -0
tmp/tmpx7e88b97/{from.md → to.md} RENAMED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Deprecated standard code conversion facets <a id="depr.locale.stdcvt">[[depr.locale.stdcvt]]</a>
2
+
3
+ The header `<codecvt>` provides code conversion facets for various
4
+ character encodings.
5
+
6
+ ### Header `<codecvt>` synopsis <a id="depr.codecvt.syn">[[depr.codecvt.syn]]</a>
7
+
8
+ ``` cpp
9
+ namespace std {
10
+ enum codecvt_mode {
11
+ consume_header = 4,
12
+ generate_header = 2,
13
+ little_endian = 1
14
+ };
15
+
16
+ template <class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0>
17
+ class codecvt_utf8 : public codecvt<Elem, char, mbstate_t> {
18
+ public:
19
+ explicit codecvt_utf8(size_t refs = 0);
20
+ ~codecvt_utf8();
21
+ };
22
+
23
+ template <class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0>
24
+ class codecvt_utf16 : public codecvt<Elem, char, mbstate_t> {
25
+ public:
26
+ explicit codecvt_utf16(size_t refs = 0);
27
+ ~codecvt_utf16();
28
+ };
29
+
30
+ template <class Elem, unsigned long Maxcode = 0x10ffff, codecvt_mode Mode = (codecvt_mode)0>
31
+ class codecvt_utf8_utf16 : public codecvt<Elem, char, mbstate_t> {
32
+ public:
33
+ explicit codecvt_utf8_utf16(size_t refs = 0);
34
+ ~codecvt_utf8_utf16();
35
+ };
36
+ }
37
+ ```
38
+
39
+ ### Requirements <a id="depr.locale.stdcvt.req">[[depr.locale.stdcvt.req]]</a>
40
+
41
+ For each of the three code conversion facets `codecvt_utf8`,
42
+ `codecvt_utf16`, and `codecvt_utf8_utf16`:
43
+
44
+ - `Elem` is the wide-character type, such as `wchar_t`, `char16_t`, or
45
+ `char32_t`.
46
+ - `Maxcode` is the largest wide-character code that the facet will read
47
+ or write without reporting a conversion error.
48
+ - If `(Mode & consume_header)`, the facet shall consume an initial
49
+ header sequence, if present, when reading a multibyte sequence to
50
+ determine the endianness of the subsequent multibyte sequence to be
51
+ read.
52
+ - If `(Mode & generate_header)`, the facet shall generate an initial
53
+ header sequence when writing a multibyte sequence to advertise the
54
+ endianness of the subsequent multibyte sequence to be written.
55
+ - If `(Mode & little_endian)`, the facet shall generate a multibyte
56
+ sequence in little-endian order, as opposed to the default big-endian
57
+ order.
58
+
59
+ For the facet `codecvt_utf8`:
60
+
61
+ - The facet shall convert between UTF-8 multibyte sequences and UCS2 or
62
+ UCS4 (depending on the size of `Elem`) within the program.
63
+ - Endianness shall not affect how multibyte sequences are read or
64
+ written.
65
+ - The multibyte sequences may be written as either a text or a binary
66
+ file.
67
+
68
+ For the facet `codecvt_utf16`:
69
+
70
+ - The facet shall convert between UTF-16 multibyte sequences and UCS2 or
71
+ UCS4 (depending on the size of `Elem`) within the program.
72
+ - Multibyte sequences shall be read or written according to the `Mode`
73
+ flag, as set out above.
74
+ - The multibyte sequences may be written only as a binary file.
75
+ Attempting to write to a text file produces undefined behavior.
76
+
77
+ For the facet `codecvt_utf8_utf16`:
78
+
79
+ - The facet shall convert between UTF-8 multibyte sequences and UTF-16
80
+ (one or two 16-bit codes) within the program.
81
+ - Endianness shall not affect how multibyte sequences are read or
82
+ written.
83
+ - The multibyte sequences may be written as either a text or a binary
84
+ file.
85
+
86
+ ISO/IEC 10646-1:1993.
87
+