interface/wx/strconv.h File Reference | wxWidgets

| Version: 3.2.11

Loading...
Searching...
No Matches
Classes | Variables
strconv.h File Reference

## Classes
class | wxMBConv
| This class is the base class of a hierarchy of classes capable of converting text strings between multibyte (SBCS or DBCS) encodings and Unicode. More...
class | wxMBConvUTF7
| This class converts between the UTF-7 encoding and Unicode. More...
class | wxMBConvUTF8
| This class converts between the UTF-8 encoding and Unicode. More...
class | wxMBConvUTF16
| This class is used to convert between multibyte encodings and UTF-16 Unicode encoding (also known as UCS-2). More...
class | wxMBConvUTF32
| This class is used to convert between multibyte encodings and UTF-32 Unicode encoding (also known as UCS-4). More...
class | wxCSConv
| This class converts between any character set supported by the system and Unicode. More...

## Variables
wxMBConv & | wxConvWhateverWorks
| Conversion object always producing non-empty output for non-empty input.
wxMBConv * | wxConvFileName
| Conversion object used for converting file names from their external representation to the one used inside the program.

## Variable Documentation

## ◆ wxConvWhateverWorks

wxMBConv& wxConvWhateverWorks
| extern

Conversion object always producing non-empty output for non-empty input.

Conversions done using this object never lose data, at the cost of possibly producing the output in an unwanted encoding or misinterpreting input encoding.

To be precise, converting Unicode to multibyte strings using this object tries to use the current locale encoding first but if this doesn't work, it falls back to using UTF-8. In the other direction, UTF-8 is tried first, then the current locale encoding and if this fails too, input is interpreted as using ISO 8859-1, which never fails.

It is almost always wrong to use this converter for multibyte-to-Unicode direction as the program should know which encoding the input data is supposed to use and use the appropriate converter instead. However it may be useful in the Unicode-to-multibyte direction if the goal is to produce the output in the current locale encoding if possible, but still output something, instead of nothing at all, even if the Unicode string is not representable in this encoding.

Since
  3.1.0