## wxMBConvUTF16

This class is used to convert between multibyte encodings and UTF-16 Unicode encoding (also known as UCS-2). Unlike UTF-8 encoding, UTF-16 uses words and not bytes and hence depends on the byte ordering: big or little endian. Hence this class is provided in two versions: wxMBConvUTF16LE and wxMBConvUTF16BE and wxMBConvUTF16 itself is just a typedef for one of them (native for the given platform, e.g. LE under Windows and BE under Mac).

Derived from

wxMBConv

Include files

<wx/strconv.h>

See also

wxMBConvUTF8, wxMBConvUTF32, wxMBConv classes overview

Members

wxMBConvUTF16::MB2WC
wxMBConvUTF16::WC2MB

### wxMBConvUTF16::MB2WC

size_t MB2WC(wchar_t* buf, const char* psz, size_t n) const

Converts from UTF-16 encoding to Unicode. Returns the size of the destination buffer.

### wxMBConvUTF16::WC2MB

size_t WC2MB(char* buf, const wchar_t* psz, size_t n) const

Converts from Unicode to UTF-16 encoding. Returns the size of the destination buffer.