## wxCSConv

This class converts between any character sets and Unicode. It has one predefined instance, wxConvLocal, for the default user character set.

Derived from

wxMBConv

Include files

<wx/strconv.h>

See also

wxMBConv, wxEncodingConverter, wxMBConv classes overview

Members

wxCSConv::wxCSConv
wxCSConv::~wxCSConv
wxCSConv::IsOk
wxCSConv::MB2WC
wxCSConv::WC2MB

### wxCSConv::wxCSConv

wxCSConv(const wxChar* charset)

wxCSConv(wxFontEncoding encoding)

Constructor. You may specify either the name of the character set you want to convert from/to or an encoding constant. If the character set name (or the encoding) is not recognized, ISO 8859-1 is used as fall back.

### wxCSConv::~wxCSConv

~wxCSConv()

Destructor frees any resources needed to perform the conversion.

### wxCSConv::IsOk

bool IsOk() const

Returns `true` if the charset (or the encoding) given at constructor is really available to use. Returns `false` if ISO 8859-1 will be used instead.

Note this does not mean that a given string will be correctly converted. A malformed string may still make conversion functions return `wxCONV_FAILED`.

This function is new since wxWidgets version 2.8.2

### wxCSConv::MB2WC

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

Converts from the selected character set to Unicode. Returns length of string written to destination buffer.

### wxCSConv::WC2MB

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

Converts from Unicode to the selected character set. Returns length of string written to destination buffer.