<class name="QTextCodec" doc="/**
&lt;p&gt;The &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; class provides conversions between text encodings.&lt;/p&gt;
&lt;p&gt;Qt uses Unicode to store, draw and manipulate strings. In many situations you may wish to deal with data that uses a different encoding. For example, most Japanese documents are still stored in Shift-JIS or ISO 2022-JP, while Russian users often have their documents in KOI8-R or Windows-1251.&lt;/p&gt;
&lt;p&gt;Qt provides a set of &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; classes to help with converting non-Unicode formats to and from Unicode. You can also create your own codec classes.&lt;/p&gt;
&lt;p&gt;The supported encodings are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apple Roman&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;%2E%2E/codec-big5.html&quot;&gt;&lt;tt&gt;Big5&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;%2E%2E/codec-big5hkscs.html&quot;&gt;&lt;tt&gt;Big5-HKSCS&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;%2E%2E/codec-eucjp.html&quot;&gt;EUC-JP&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;%2E%2E/codec-euckr.html&quot;&gt;EUC-KR&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;%2E%2E/codec-gbk.html&quot;&gt;GB18030-0&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;IBM 850&lt;/li&gt;
&lt;li&gt;IBM 866&lt;/li&gt;
&lt;li&gt;IBM 874&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;%2E%2E/codecs-jis.html&quot;&gt;ISO 2022-JP&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;ISO 8859-1 to 10&lt;/li&gt;
&lt;li&gt;ISO 8859-13 to 16&lt;/li&gt;
&lt;li&gt;Iscii-Bng, Dev, Gjr, Knd, Mlm, Ori, Pnj, Tlg, and Tml&lt;/li&gt;
&lt;li&gt;JIS X 0201&lt;/li&gt;
&lt;li&gt;JIS X 0208&lt;/li&gt;
&lt;li&gt;KOI8-R&lt;/li&gt;
&lt;li&gt;KOI8-U&lt;/li&gt;
&lt;li&gt;MuleLao-1&lt;/li&gt;
&lt;li&gt;ROMAN8&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;%2E%2E/codec-sjis.html&quot;&gt;Shift-JIS&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;TIS-620&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;%2E%2E/codec-tscii.html&quot;&gt;TSCII&lt;/tt&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;UTF-8&lt;/li&gt;
&lt;li&gt;UTF-16&lt;/li&gt;
&lt;li&gt;UTF-16BE&lt;/li&gt;
&lt;li&gt;UTF-16LE&lt;/li&gt;
&lt;li&gt;Windows-1250 to 1258&lt;/li&gt;
&lt;li&gt;WINSAMI2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;QTextCodecs can be used as follows to convert some locally encoded string to Unicode. Suppose you have some string encoded in Russian KOI8-R encoding, and want to convert it to Unicode. The simple way to do it is like this:&lt;/p&gt;
&lt;pre&gt;    QByteArray encodedString = &amp;quot;...&amp;quot;;
    QTextCodec *codec = QTextCodec::codecForName(&amp;quot;KOI8-R&amp;quot;);
    QString string = codec-&amp;gt;toUnicode(encodedString);&lt;/pre&gt;
&lt;p&gt;After this, &lt;tt&gt;string&lt;/tt&gt; holds the text converted to Unicode. Converting a string from Unicode to the local encoding is just as easy:&lt;/p&gt;
&lt;pre&gt;    QString string = &amp;quot;...&amp;quot;;
    QTextCodec *codec = QTextCodec::codecForName(&amp;quot;KOI8-R&amp;quot;);
    QByteArray encodedString = codec-&amp;gt;fromUnicode(string);&lt;/pre&gt;
&lt;p&gt;To read or write files in various encodings, use &lt;a href=&quot;QTextStream.html&quot;&gt;&lt;tt&gt;QTextStream&lt;/tt&gt;&lt;/a&gt; and its setCodec() function. See the Codecs&lt;/tt&gt; example for an application of &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; to file I/O.&lt;/p&gt;
&lt;p&gt;Some care must be taken when trying to convert the data in chunks, for example, when receiving it over a network. In such cases it is possible that a multi-byte character will be split over two chunks. At best this might result in the loss of a character and at worst cause the entire conversion to fail.&lt;/p&gt;
&lt;p&gt;The approach to use in these situations is to create a &lt;a href=&quot;QTextDecoder.html&quot;&gt;&lt;tt&gt;QTextDecoder&lt;/tt&gt;&lt;/a&gt; object for the codec and use this &lt;a href=&quot;QTextDecoder.html&quot;&gt;&lt;tt&gt;QTextDecoder&lt;/tt&gt;&lt;/a&gt; for the whole decoding process, as shown below:&lt;/p&gt;
&lt;pre&gt;    QTextCodec *codec = QTextCodec::codecForName(&amp;quot;Shift-JIS&amp;quot;);
    QTextDecoder *decoder = codec-&amp;gt;makeDecoder();

    QString string;
    while (new_data_available()) {
        QByteArray chunk = get_new_data();
        string += decoder-&amp;gt;toUnicode(chunk);
    }&lt;/pre&gt;
&lt;p&gt;The &lt;a href=&quot;QTextDecoder.html&quot;&gt;&lt;tt&gt;QTextDecoder&lt;/tt&gt;&lt;/a&gt; object maintains state between chunks and therefore works correctly even if a multi-byte character is split between chunks.&lt;/p&gt;
&lt;a name=&quot;creating-your-own-codec-class&quot;&gt;&lt;/a&gt;
&lt;h3&gt;Creating Your Own Codec Class&lt;/h3&gt;
&lt;p&gt;Support for new text encodings can be added to Qt by creating &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; subclasses.&lt;/p&gt;
&lt;p&gt;The pure virtual functions describe the encoder to the system and the coder is used as required in the different text file formats supported by &lt;a href=&quot;QTextStream.html&quot;&gt;&lt;tt&gt;QTextStream&lt;/tt&gt;&lt;/a&gt;, and under X11, for the locale-specific character input and output.&lt;/p&gt;
&lt;p&gt;To add support for another encoding to Qt, make a subclass of &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; and implement the functions listed in the table below.&lt;/p&gt;
&lt;p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; border=&quot;0&quot;&gt;
&lt;thead&gt;&lt;tr valign=&quot;top&quot; class=&quot;qt-style&quot;&gt;&lt;th&gt;Function&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;a href=&quot;QTextCodec.html#name()&quot;&gt;&lt;tt&gt;name&lt;/tt&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Returns the official name for the encoding. If the ncoding is listed in the &lt;a href=&quot;http://www.iana.org/assignments/character-sets&quot;&gt;IANA character-sets encoding file&lt;/tt&gt;&lt;/a&gt;, the name should be the preferred MIME name for the encoding.&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;&lt;a href=&quot;QTextCodec.html#aliases()&quot;&gt;&lt;tt&gt;aliases&lt;/tt&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Returns a list of alternative names for the encoding. &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; provides a default implementation that returns an empty list. For example, &amp;quot;ISO-8859-1&amp;quot; has &amp;quot;latin1&amp;quot;, &amp;quot;CP819&amp;quot;, &amp;quot;IBM819&amp;quot;, and &amp;quot;iso-ir-100&amp;quot; as aliases.&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;a href=&quot;QTextCodec.html#mibEnum()&quot;&gt;&lt;tt&gt;mibEnum&lt;/tt&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Return the MIB enum for the encoding if it is listed in the &lt;a href=&quot;http://www.iana.org/assignments/character-sets&quot;&gt;IANA character-sets encoding file&lt;/tt&gt;&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;&lt;a href=&quot;QTextCodec.html#convertToUnicode(byte[], int, com.trolltech.qt.core.QTextCodec_ConverterState)&quot;&gt;&lt;tt&gt;convertToUnicode&lt;/tt&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Converts an 8-bit character string to Unicode.&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;a href=&quot;QTextCodec.html#convertFromUnicode(char[], int, com.trolltech.qt.core.QTextCodec_ConverterState)&quot;&gt;&lt;tt&gt;convertFromUnicode&lt;/tt&gt;&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Converts a Unicode string to an 8-bit character string.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;You may find it more convenient to make your codec class available as a plugin; see &lt;a href=&quot;%2E%2E/plugins-howto.html&quot;&gt;How to Create Qt Plugins&lt;/tt&gt;&lt;/a&gt; for details.&lt;/p&gt;

@see &lt;a href=&quot;QTextStream.html&quot;&gt;&lt;tt&gt;QTextStream&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextDecoder.html&quot;&gt;&lt;tt&gt;QTextDecoder&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextEncoder.html&quot;&gt;&lt;tt&gt;QTextEncoder&lt;/tt&gt;&lt;/a&gt;
@see Codecs Example&lt;/tt&gt; */">
    <method name="protected QTextCodec()" doc="/**
&lt;p&gt;Constructs a &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt;, and gives it the highest precedence. The &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; should always be constructed on the heap (i.e&amp;#x2e; with &lt;tt&gt;new&lt;/tt&gt;). Qt takes ownership and will delete it when the application terminates.&lt;/p&gt;
 */"/>
    <method name="public final boolean canEncode(java.lang.String arg__1)" doc="/**
&lt;p&gt;&lt;tt&gt;arg__1&lt;/tt&gt; contains the string being tested for encode-ability.&lt;/p&gt;
 */"/>
    <method name="public final boolean canEncode(char arg__1)" doc="/**
&lt;p&gt;Returns true if the Unicode character &lt;tt&gt;arg__1&lt;/tt&gt; can be fully encoded with this codec; otherwise returns false.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.core.QByteArray fromUnicode(java.lang.String uc)" doc="/**
&lt;p&gt;Converts &lt;tt&gt;uc&lt;/tt&gt; from Unicode to the encoding of this codec, and returns the result in a &lt;a href=&quot;QByteArray.html&quot;&gt;&lt;tt&gt;QByteArray&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.core.QTextDecoder makeDecoder()" doc="/**
&lt;p&gt;Creates a &lt;a href=&quot;QTextDecoder.html&quot;&gt;&lt;tt&gt;QTextDecoder&lt;/tt&gt;&lt;/a&gt; which stores enough state to decode chunks of &lt;tt&gt;char *&lt;/tt&gt; data to create chunks of Unicode data.&lt;/p&gt;
&lt;p&gt;The caller is responsible for deleting the returned object.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.core.QTextEncoder makeEncoder()" doc="/**
&lt;p&gt;Creates a &lt;a href=&quot;QTextEncoder.html&quot;&gt;&lt;tt&gt;QTextEncoder&lt;/tt&gt;&lt;/a&gt; which stores enough state to encode chunks of Unicode data as &lt;tt&gt;char *&lt;/tt&gt; data.&lt;/p&gt;
&lt;p&gt;The caller is responsible for deleting the returned object.&lt;/p&gt;
 */"/>
    <method name="public final java.lang.String toUnicode(com.trolltech.qt.core.QByteArray arg__1)" doc="/**
&lt;p&gt;Converts &lt;tt&gt;arg__1&lt;/tt&gt; from the encoding of this codec to Unicode, and returns the result in a &lt;a href=&quot;%2E%2E/porting4.html#qstring&quot;&gt;&lt;tt&gt;QString&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
    <method name="public java.util.List&lt;com.trolltech.qt.core.QByteArray&gt; aliases()" doc="/**
&lt;p&gt;Subclasses can return a number of aliases for the codec in question.&lt;/p&gt;
&lt;p&gt;Standard aliases for codecs can be found in the &lt;a href=&quot;http://www.iana.org/assignments/character-sets&quot;&gt;IANA character-sets encoding file&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
    <method name="protected abstract com.trolltech.qt.core.QByteArray convertFromUnicode(char[] in, int length, com.trolltech.qt.core.QTextCodec_ConverterState state)" doc="/**
&lt;p&gt;&lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; subclasses must reimplement this function.&lt;/p&gt;
&lt;p&gt;Converts the first &lt;tt&gt;length&lt;/tt&gt; of characters from the &lt;tt&gt;in&lt;/tt&gt; array from Unicode to the encoding of the subclass, and returns the result in a &lt;a href=&quot;QByteArray.html&quot;&gt;&lt;tt&gt;QByteArray&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;state&lt;/tt&gt; can be 0 in which case the conversion is stateless and default conversion rules should be used. If state is not 0, the codec should save the state after the conversion in &lt;tt&gt;state&lt;/tt&gt;, and adjust the remainingChars and invalidChars members of the struct.&lt;/p&gt;
 */"/>
    <method name="protected abstract java.lang.String convertToUnicode(byte[] in, int length, com.trolltech.qt.core.QTextCodec_ConverterState state)" doc="/**
&lt;p&gt;&lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; subclasses must reimplement this function.&lt;/p&gt;
&lt;p&gt;Converts the first &lt;tt&gt;length&lt;/tt&gt; characters of &lt;tt&gt;in&lt;/tt&gt; from the encoding of the subclass to Unicode, and returns the result in a &lt;a href=&quot;%2E%2E/porting4.html#qstring&quot;&gt;&lt;tt&gt;QString&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;state&lt;/tt&gt; can be 0, in which case the conversion is stateless and default conversion rules should be used. If state is not 0, the codec should save the state after the conversion in &lt;tt&gt;state&lt;/tt&gt;, and adjust the remainingChars and invalidChars members of the struct.&lt;/p&gt;
 */"/>
    <method name="public abstract int mibEnum()" doc="/**
&lt;p&gt;Subclasses of &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; must reimplement this function. It returns the MIBenum (see &lt;a href=&quot;http://www.iana.org/assignments/character-sets&quot;&gt;the IANA character-sets encoding file&lt;/tt&gt;&lt;/a&gt; for more information). It is important that each &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; subclass returns the correct unique value for this function.&lt;/p&gt;
 */"/>
    <method name="public abstract com.trolltech.qt.core.QByteArray name()" doc="/**
&lt;p&gt;&lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; subclasses must reimplement this function. It returns the name of the encoding supported by the subclass.&lt;/p&gt;
&lt;p&gt;If the codec is registered as a character set in the &lt;a href=&quot;http://www.iana.org/assignments/character-sets&quot;&gt;IANA character-sets encoding file&lt;/tt&gt;&lt;/a&gt; this method should return the preferred mime name for the codec if defined, otherwise its name.&lt;/p&gt;
 */"/>
    <method name="public native static java.util.List&lt;com.trolltech.qt.core.QByteArray&gt; availableCodecs()" doc="/**
&lt;p&gt;Returns the list of all available codecs, by name. Call QTextCodec::codecForName() to obtain the &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; for the name.&lt;/p&gt;
&lt;p&gt;The list may contain many mentions of the same codec if the codec has aliases.&lt;/p&gt;

@see &lt;a href=&quot;QTextCodec.html#availableMibs()&quot;&gt;&lt;tt&gt;availableMibs&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextCodec.html#name()&quot;&gt;&lt;tt&gt;name&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextCodec.html#aliases()&quot;&gt;&lt;tt&gt;aliases&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public native static java.util.List&lt;java.lang.Integer&gt; availableMibs()" doc="/**
&lt;p&gt;Returns the list of MIBs for all available codecs. Call QTextCodec::codecForMib() to obtain the &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; for the MIB.&lt;/p&gt;

@see &lt;a href=&quot;QTextCodec.html#availableCodecs()&quot;&gt;&lt;tt&gt;availableCodecs&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextCodec.html#mibEnum()&quot;&gt;&lt;tt&gt;mibEnum&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public native static com.trolltech.qt.core.QTextCodec codecForCStrings()" doc="/**
&lt;p&gt;Returns the codec used by &lt;a href=&quot;%2E%2E/porting4.html#qstring&quot;&gt;&lt;tt&gt;QString&lt;/tt&gt;&lt;/a&gt; to convert to and from &lt;tt&gt;const char *&lt;/tt&gt; and QByteArrays. If this function returns 0 (the default), &lt;a href=&quot;%2E%2E/porting4.html#qstring&quot;&gt;&lt;tt&gt;QString&lt;/tt&gt;&lt;/a&gt; assumes Latin-1.&lt;/p&gt;

@see &lt;a href=&quot;QTextCodec.html#setCodecForCStrings(com.trolltech.qt.core.QTextCodec)&quot;&gt;&lt;tt&gt;setCodecForCStrings&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public static com.trolltech.qt.core.QTextCodec codecForHtml(com.trolltech.qt.core.QByteArray ba)" doc="/**
&lt;p&gt;&lt;/p&gt;
 */"/>
    <method name="public native static com.trolltech.qt.core.QTextCodec codecForLocale()" doc="/**
&lt;p&gt;Returns a pointer to the codec most suitable for this locale.&lt;/p&gt;
&lt;p&gt;On Windows, the codec will be based on a system locale. On Unix systems, starting with Qt 4.2, the codec will be using the &lt;i&gt;iconv&lt;/i&gt; library. Note that in both cases the codec's name will be &amp;quot;System&amp;quot;.&lt;/p&gt;

@see &lt;a href=&quot;QTextCodec.html#setCodecForLocale(com.trolltech.qt.core.QTextCodec)&quot;&gt;&lt;tt&gt;setCodecForLocale&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public native static com.trolltech.qt.core.QTextCodec codecForMib(int mib)" doc="/**
&lt;p&gt;Returns the &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; which matches the MIBenum &lt;tt&gt;mib&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public static com.trolltech.qt.core.QTextCodec codecForName(com.trolltech.qt.core.QByteArray name)" doc="/**
&lt;p&gt;Searches all installed &lt;a href=&quot;QTextCodec.html#QTextCodec()&quot;&gt;&lt;tt&gt;QTextCodec&lt;/tt&gt;&lt;/a&gt; objects and returns the one which best matches &lt;tt&gt;name&lt;/tt&gt;; the match is case-insensitive. Returns 0 if no codec matching the name &lt;tt&gt;name&lt;/tt&gt; could be found.&lt;/p&gt;
 */"/>
    <method name="public static void setCodecForCStrings(com.trolltech.qt.core.QTextCodec c)" doc="/**
&lt;p&gt;Sets the codec used by &lt;a href=&quot;%2E%2E/porting4.html#qstring&quot;&gt;&lt;tt&gt;QString&lt;/tt&gt;&lt;/a&gt; to convert to and from &lt;tt&gt;const char *&lt;/tt&gt; and QByteArrays. If the &lt;tt&gt;c&lt;/tt&gt; is 0 (the default), &lt;a href=&quot;%2E%2E/porting4.html#qstring&quot;&gt;&lt;tt&gt;QString&lt;/tt&gt;&lt;/a&gt; assumes Latin-1.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Warning:&lt;/b&gt; Some codecs do not preserve the characters in the ASCII range (0x00 to 0x7F). For example, the Japanese Shift-JIS encoding maps the backslash character (0x5A) to the Yen character. To avoid undesirable side-effects, we recommend avoiding such codecs with setCodecsForCString().&lt;/p&gt;

@see &lt;a href=&quot;QTextCodec.html#codecForCStrings()&quot;&gt;&lt;tt&gt;codecForCStrings&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;setCodecForTr&lt;/tt&gt; */"/>
    <method name="public static void setCodecForLocale(com.trolltech.qt.core.QTextCodec c)" doc="/**
&lt;p&gt;Set the codec to &lt;tt&gt;c&lt;/tt&gt;; this will be returned by &lt;a href=&quot;QTextCodec.html#codecForLocale()&quot;&gt;&lt;tt&gt;codecForLocale&lt;/tt&gt;&lt;/a&gt;. This might be needed for some applications that want to use their own mechanism for setting the locale.&lt;/p&gt;
&lt;p&gt;Setting this codec is not supported on DOS based Windows.&lt;/p&gt;

@see &lt;a href=&quot;QTextCodec.html#codecForLocale()&quot;&gt;&lt;tt&gt;codecForLocale&lt;/tt&gt;&lt;/a&gt; */"/>
    <enum name="ConversionFlag">
        <enum-value name="DefaultConversion" doc="/**
&lt;p&gt;No flag is set.&lt;/p&gt;
 */"/>
        <enum-value name="ConvertInvalidToNull" doc="/**
&lt;p&gt;If this flag is set, invalid input results in an empty string.&lt;/p&gt;
 */"/>
        <enum-value name="IgnoreHeader" doc="/**
&lt;p&gt;Ignore any Unicode byte-order mark and don't generate any.&lt;/p&gt;
 */"/>
</enum>
</class>
