Contents Up Previous Next

wxMBConvUTF8

This class converts between the UTF-8 encoding and Unicode. It has one predefined instance, wxConvUTF8.

Derived from

wxMBConv

Include files

<wx/strconv.h>

See also

wxMBConvUTF7, wxMBConv classes overview

Remarks

UTF-8 is a compatibility encoding used to encode Unicode text into anything that was originally written for 8-bit strings, including (but not limited to) filenames, transfer protocols, and database fields. Notable properties include:

All of these properties make UTF-8 a very favorable solution in any situation where full Unicode character support is desired while remaining compatible with code written with only 8-bit extended-ASCII characters in mind.

Members

wxMBConvUTF8::MB2WC
wxMBConvUTF8::WC2MB


wxMBConvUTF8::MB2WC

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

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


wxMBConvUTF8::WC2MB

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

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