Public Member Functions

# wxCSConv Class Reference
[Text Conversion]

`#include <wx/strconv.h>`

Inheritance diagram for wxCSConv:
[legend]

## Detailed Description

This class converts between any character set supported by the system and Unicode.

Please notice that this class uses system-provided conversion functions, e.g. `MultiByteToWideChar()` and `WideCharToMultiByte()` under MSW and `iconv(3)` under Unix systems and as such may support different encodings and different encoding names on different platforms (although all relatively common encodings are supported should be supported everywhere).

It has one predefined instance, wxConvLocal, for the default user character set.

##

Library: wxBase
Category: Text Conversion

See also:
  wxMBConv, wxEncodingConverter, wxMBConv Overview

## Public Member Functions
| wxCSConv (const wxString &charset)
| Constructor.
| wxCSConv (wxFontEncoding encoding)
| Constructor.
bool | IsOk () const
| Returns true if the charset (or the encoding) given at constructor is really available to use.

List of all members.

## Constructor & Destructor Documentation

wxCSConv::wxCSConv | ( | const wxString & | charset | ) |

Constructor.

You can specify the name of the character set you want to convert from/to. If the character set name is not recognized, ISO 8859-1 is used as fall back, use IsOk() to test for this.

Parameters:

  | charset | The name of the encoding, shouldn't be empty.

wxCSConv::wxCSConv | ( | wxFontEncoding | encoding | ) |

Constructor.

You can specify an encoding constant for the character set you want to convert from/to. Use IsOk() after construction to check whether the encoding is supported by the current system.

Parameters:

  | encoding | Any valid (i.e. not wxFONTENCODING_MAX) font encoding.

## Member Function Documentation

bool wxCSConv::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`.

Since:
  2.8.2

|  | [ top ]