]>
Commit | Line | Data |
---|---|---|
f6bcfd97 BP |
1 | % |
2 | % automatically generated by HelpGen from | |
3 | % ../include/wx/strconv.h at 25/Mar/00 10:20:56 | |
4 | % | |
5 | ||
6 | \section{\class{wxMBConvUTF8}}\label{wxmbconvutf8} | |
7 | ||
8 | This class converts between the UTF-8 encoding and Unicode. | |
9 | It has one predefined instance, {\bf wxConvUTF8}. | |
10 | ||
11 | \wxheading{Derived from} | |
12 | ||
13 | \helpref{wxMBConv}{wxmbconv} | |
14 | ||
15 | \wxheading{Include files} | |
16 | ||
17 | <wx/strconv.h> | |
18 | ||
a7af285d VZ |
19 | \wxheading{Library} |
20 | ||
21 | \helpref{wxBase}{librarieslist} | |
22 | ||
f6bcfd97 BP |
23 | \wxheading{See also} |
24 | ||
25 | \helpref{wxMBConvUTF7}{wxmbconvutf7}, | |
26 | \helpref{wxMBConv classes overview}{mbconvclasses} | |
27 | ||
28 | \wxheading{Remarks} | |
29 | ||
30 | UTF-8 is a compatibility encoding used to encode Unicode text into anything that was | |
31 | originally written for 8-bit strings, including (but not limited to) filenames, transfer | |
32 | protocols, and database fields. Notable properties include: | |
33 | ||
34 | \begin{itemize} | |
35 | \item Variable-length encoding able to encode up to 31 bits per character | |
36 | \item ASCII characters (character values under 128) are encoded as plain ASCII | |
37 | (1 byte per character) | |
38 | \item Null bytes do not occur in the encoding, except when there's an actual Unicode | |
39 | null character | |
40 | \item Preserves sort ordering for plain 8-bit comparison routines like strcmp() | |
2edb0bde | 41 | \item High bit patterns disambiguates character boundaries, and makes it easy to |
f6bcfd97 BP |
42 | detect whether a string is encoded with UTF-8 or not |
43 | \end{itemize} | |
44 | ||
45 | All of these properties make UTF-8 a very favorable solution in any situation | |
46 | where full Unicode character support is desired while remaining compatible with | |
47 | code written with only 8-bit extended-ASCII characters in mind. | |
48 | ||
49 | \latexignore{\rtfignore{\wxheading{Members}}} | |
50 | ||
51 | ||
52 | \membersection{wxMBConvUTF8::MB2WC}\label{wxmbconvutf8mb2wc} | |
53 | ||
54 | \constfunc{size\_t}{MB2WC}{\param{wchar\_t* }{buf}, \param{const char* }{psz}, \param{size\_t }{n}} | |
55 | ||
56 | Converts from UTF-8 encoding to Unicode. Returns the size of the destination buffer. | |
57 | ||
58 | \membersection{wxMBConvUTF8::WC2MB}\label{wxmbconvutf8wc2mb} | |
59 | ||
60 | \constfunc{size\_t}{WC2MB}{\param{char* }{buf}, \param{const wchar\_t* }{psz}, \param{size\_t }{n}} | |
61 | ||
62 | Converts from Unicode to UTF-8 encoding. Returns the size of the destination buffer. | |
63 |