From Jason Turner

[depr.locale.stdcvt]

Diff to HTML by rtfpessoa

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