wxmbconvfilethis class used to define the class instance wxconvfilename, but nowadays wxconvfilename is either of type wxconvlibc (on most platforms) or wxconvutf8 (on macos x). wxconvfilename converts filenames between filesystem multibyte encoding and unicode. wxconvfilename can also be set to a something else at run-time which is used e.g. by wxgtk to use a class which checks the environment variable g_filesystem_encoding indicating that filenames should not be interpreted as utf8 and also for converting invalid utf8 characters (e.g. if there is a filename in iso8859_1) to strings with octal values. since some platforms (such as win32) use unicode in the filenames, and others (such as unix) use multibyte encodings, this class should only be used directly if wxmbfiles is defined to 1. a convenience macro, wxfnconv, is defined to wxconvfilename->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 include files <wx/strconv.h> see also members
wxmbconvfile::mb2wc
wxmbconvfile::mb2wcsize_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::wc2mbsize_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.
|