Description
The codecvt facet of locale is used to convert between different codesets, for example between wide characters (of type wchar_t) and multibyte characters.
An example of where codecvt would be used is with C++ files. In C++, a disk file is a stream of bytes, and groups of one or more bytes are used to form characters. For example, groups of two bytes in a file may constitute wide characters of type wchar_t. And wchar_t characters in a program would in turn be converted to multibyte character sequences for writing to a file.
Concept
The sample program converts between an external representation of a string, using char*, and an internal representation that uses wchar_t*. The function in() is used for this conversion. A vector of two chars (external representation) is converted into a similar vector of two wchar_ts (internal representation). Then the reverse process is performed, using out(). The converted characters are stored back into the original array.
Special Notes:
codecvt<char,char,mbstate_t> is a degenerate case that does no conversion.
Supported
Supported
Supported
