Namespaces
Variants
Actions

std::codecvt_utf16

From cppreference.com
< cpp‎ | locale
 
 
 
 
Defined in header <codecvt>
template<

    class Elem,
    unsigned long Maxcode = 0x10ffff,
    std::codecvt_mode Mode = (std::codecvt_mode)0 >
class codecvt_utf16

    : public std::codecvt<Elem, char, std::mbstate_t>;
(since C++11)
(deprecated in C++17)
(removed in C++26)

std::codecvt_utf16 is a std::codecvt facet which encapsulates conversion between a UTF-16 encoded byte string and UCS-2 or UTF-32 character string (depending on the type of Elem). This std::codecvt facet can be used to read and write UTF-16 files in binary mode.

UCS-2 is an archaic encoding that is a subset of UTF-16, which encodes scalar values in the range U+0000-U+FFFF (Basic Multilingual Plane) only.

Contents