## wxMBConvFile

This class converts file names between filesystem multibyte encoding and Unicode. It has one predefined instance, wxConvFile. Since some platforms (e.g. Win32) use Unicode in the filenames, and others (e.g. Unix) use multibyte encodings, this class should only be used directly if wxMBFILES is defined to 1. A convenience macro, wxFNCONV, is defined to wxConvFile.cWX2MB in this case. You could use it like this:

    wxChar *name = wxT("rawfile.doc");
    FILE *fil = fopen(wxFNCONV(name), "r");

(although it would be better to use wxFopen(name, wxT("r")) in this case.)

Derived from

wxMBConv

Include files

<wx/strconv.h>

See also

wxMBConv classes overview

Members

wxMBConvFile::MB2WC
wxMBConvFile::WC2MB

### wxMBConvFile::MB2WC

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

Converts from multibyte filename encoding to Unicode. Returns the size of the destination buffer.

### wxMBConvFile::WC2MB

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

Converts from Unicode to multibyte filename encoding. Returns the size of the destination buffer.