2 % automatically generated by HelpGen from
3 % encconv.h at 30/Dec/99 18:45:16
7 \section{\class{wxEncodingConverter
}}\label{wxencodingconverter
}
9 This class is capable of converting strings between any two
10 8bit encodings/charsets. It can also convert from/to Unicode (but only
11 if you compiled wxWindows with wxUSE_UNICODE set to
1).
14 \wxheading{Derived from
}
16 \helpref{wxObject
}{wxobject
}
19 \latexignore{\rtfignore{\wxheading{Members
}}}
22 \membersection{wxEncodingConverter::wxEncodingConverter
}\label{wxencodingconverterwxencodingconverter
}
24 \func{}{wxEncodingConverter
}{\void}
28 \membersection{wxEncodingConverter::Init
}\label{wxencodingconverterinit
}
30 \func{bool
}{Init
}{\param{wxFontEncoding
}{input
\_enc},
\param{wxFontEncoding
}{output
\_enc},
\param{int
}{method = wxCONVERT
\_STRICT}}
32 Initialize convertion. Both output or input encoding may
33 be wxFONTENCODING
\_UNICODE, but only if wxUSE
\_ENCODING is set to
1.
34 All subsequent calls to
\helpref{Convert()
}{wxencodingconverterconvert
}
35 will interpret it's argument
36 as a string in
{\it input
\_enc} encoding and will output string in
37 {\it output
\_enc} encoding.
38 You must call this method before calling Convert. You may call
39 it more than once in order to switch to another conversion.
40 {\it Method
} affects behaviour of Convert() in case input character
41 cannot be converted because it does not exist in output encoding:
44 \twocolitem{{\bf wxCONVERT
\_STRICT}}{follow behaviour of GNU Recode -
45 just copy unconvertable characters to output and don't change them
46 (its integer value will stay the same)
}
47 \twocolitem{{\bf wxCONVERT
\_SUBSTITUTE}}{try some (lossy) substitutions
48 - e.g. replace unconvertable latin capitals with acute by ordinary
49 capitals, replace en-dash or em-dash by '-' etc.
}
52 Both modes gurantee that output string will have same length
55 \wxheading{Return value
}
57 FALSE if given conversion is impossible, TRUE otherwise
58 (conversion may be impossible either if you try to convert
59 to Unicode with non-Unicode build of wxWindows or if input
60 or output encoding is not supported.)
63 \membersection{wxEncodingConverter::Convert
}\label{wxencodingconverterconvert
}
65 \func{wxString
}{Convert
}{\param{const wxString\&
}{input
}}
67 \func{void
}{Convert
}{\param{const wxChar*
}{input
},
\param{wxChar*
}{output
}}
69 \func{void
}{Convert
}{\param{wxChar*
}{str
}}
71 \func{void
}{Convert
}{\param{const char*
}{input
},
\param{wxChar*
}{output
}}
73 Convert input string according to settings passed to
\helpref{Init
}{wxencodingconverterinit
}.
74 Note that you must call Init before using Convert!
78 \membersection{wxEncodingConverter::GetPlatformEquivalents
}\label{wxencodingconvertergetplatformequivalents
}
80 \func{static wxFontEncodingArray
}{GetPlatformEquivalents
}{\param{wxFontEncoding
}{enc
},
\param{int
}{platform = wxPLATFORM
\_CURRENT}}
82 Return equivalents for given font that are used
83 under given platform. Supported platforms:
86 \item wxPLATFORM
\_UNIX
87 \item wxPLATFORM
\_WINDOWS
90 \item wxPLATFORM
\_CURRENT
93 wxPLATFORM
\_CURRENT means the plaform this binary was compiled for.
97 current platform enc returned value
98 ----------------------------------------------
99 unix CP1250
{ISO8859_2
}
100 unix ISO8859_2
{ISO8859_2
}
101 windows ISO8859_2
{CP1250
}
102 unix CP1252
{ISO8859_1,ISO8859_15
}
105 Equivalence is defined in terms of convertibility:
106 2 encodings are equivalent if you can convert text between
107 then without loosing information (it may - and will - happen
108 that you loose special chars like quotation marks or em-dashes
109 but you shouldn't loose any diacritics and language-specific
110 characters when converting between equivalent encodings).
112 Remember that this function does
{\bf NOT
} check for presence of
113 fonts in system. It only tells you what are most suitable
114 encodings. (It usually returns only one encoding.)
119 \item Note that argument
{\it enc
} itself may be present in returned array!
120 (So that you can - as a side effect - detect whether the
121 encoding is native for this platform or not.)
123 \item helpref
{Convert
}{wxencodingconverterconvert
} is not limited to
124 converting between equivalent encodings, it can convert between arbitrary
127 \item If
{\it enc
} is present in returned array, then it is
{\bf always
} first
130 \item Please not that returned array may not contain any item at all!
134 \membersection{wxEncodingConverter::GetAllEquivalents
}\label{wxencodingconvertergetallequivalents
}
136 \func{static wxFontEncodingArray
}{GetAllEquivalents
}{\param{wxFontEncoding
}{enc
}}
139 \helpref{GetPlatformEquivalents
}{wxencodingconvertergetplatformequivalents
},
140 but this one will return ALL
141 equivalent encodings, regardless the platform, and including itself.
143 This platform's encodings are before others in the array. And again, if
{\it enc
} is in the array,
144 it is the very first item in it.