Version: 3.0.5
Text Conversion

Detailed Description

These are the classes used for conversions between different text encodings.

Classes

class  wxEncodingConverter
 
class  wxMBConv
 
class  wxMBConvUTF7
 
class  wxMBConvUTF8
 
class  wxMBConvUTF16
 
class  wxMBConvUTF32
 
class  wxCSConv
 

Variables

wxMBConvwxConvFileName
 Conversion object used for converting file names from their external representation to the one used inside the program. More...
 

Variable Documentation

◆ wxConvFileName

wxMBConv* wxConvFileName

Conversion object used for converting file names from their external representation to the one used inside the program.

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 an object 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 object 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 = "rawfile.doc";
FILE *fil = fopen(wxFNCONV(name), "r");

(although it would be better to just use wxFopen(name, "r") in this particular case, you only need to use this object for functions taking file names not wrapped by wxWidgets.)

Library:  wxBase

<>< =''>:</>&;&;< =''>\ </></>

See also
wxMBConv Overview
wxUSE_UNICODE_dependent wxChar
wxChar is defined to be - char when wxUSE_UNICODE==0 - wchar_t when wxUSE_UNICODE==1 (the default).
Definition: chartype.h:105