byte_string to_bytes( Elem wchar );
(1)byte_string to_bytes( const Elem* wptr );
(2)byte_string to_bytes( const wide_string& wstr );
(3)byte_string to_bytes( const Elem* first, const Elem* last );
(4)Converts a wide sequence to a byte string using the facet pointed to by cvtptr
.
1) The wide sequence only consists of one element byte.
2) The wide sequence is the null-terminated sequence beginning at ptr.
3) The wide sequence is the sequence contained in str.
4) The wide sequence is the range [
first,
last)
.
Before the conversion begins, if *this was not constructed with constructor overload (3), cvtstate
will be set to its default value (the initial conversion state).
The number of input elements successfully converted will be stored in cvtcount
.
If the conversion succeeds, returns the conversion result. Otherwise, if *this is constructed with constructor overload (4), returns byte_err_string
.
If the conversion fails and *this was not constructed with constructor overload (4), throws std::range_error.
[edit] ExampleOutput:
UTF-8 conversion produced 10 bytes: 7a c3 9f e6 b0 b4 f0 9f 8d 8c UTF-16le conversion produced 10 bytes: 7a 00 df 00 34 6c 3c d8 4c df[edit] See also converts a byte string into a wide string
InternT
to ExternT
, such as when writing to file
std::codecvt<InternT,ExternT,StateT>
) [edit]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4