X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..6f63704ff4db9da6976547a1378d7e85b966eea7:/docs/latex/wx/tmbconv.tex?ds=sidebyside diff --git a/docs/latex/wx/tmbconv.tex b/docs/latex/wx/tmbconv.tex index 4401bfa99b..7a4213f9f5 100644 --- a/docs/latex/wx/tmbconv.tex +++ b/docs/latex/wx/tmbconv.tex @@ -11,9 +11,10 @@ \section{wxMBConv classes overview}\label{mbconvclasses} -Classes: \helpref{wxMBConv}{wxmbconv}, \helpref{wxMBConvFile}{wxmbconvfile}, +Classes: \helpref{wxMBConv}{wxmbconv}, \helpref{wxMBConvLibc}{wxmbconvlibc}, \helpref{wxMBConvUTF7}{wxmbconvutf7}, \helpref{wxMBConvUTF8}{wxmbconvutf8}, -\helpref{wxCSConv}{wxcsconv} +\helpref{wxCSConv}{wxcsconv}, +\helpref{wxMBConvUTF16}{wxmbconvutf16}, \helpref{wxMBConvUTF32}{wxmbconvutf32} The wxMBConv classes in wxWindows enables an Unicode-aware application to easily convert between Unicode and the variety of 8-bit encoding systems still @@ -57,23 +58,21 @@ traditional 8-bit-encoding. And this is what the wxMBConv classes do. The base class for all these conversions is the wxMBConv class (which itself implements standard libc locale conversion). Derived classes include -wxMBConvFile, wxMBConvUTF7, wxMBConvUTF8, and wxCSConv, which implement -different kinds of conversions. You can also derive your own class for your -own custom encoding and use it, should you need it. All you need to do is -override the MB2WC and WC2MB methods. +wxMBConvLibc, several different wxMBConvUTFxxx classes, and wxCSConv, which +implement different kinds of conversions. You can also derive your own class +for your own custom encoding and use it, should you need it. All you need to do +is override the MB2WC and WC2MB methods. \subsection{wxMBConv objects} -In C++, for a class to be useful and possible to pass around, it needs to be -instantiated. All of the wxWindows-provided wxMBConv classes have predefined -instances (wxConvLibc, wxConvFile, wxConvUTF7, wxConvUTF8, wxConvLocal). -You can use these predefined objects directly, or you can instantiate your own -objects. +Several of the wxWindows-provided wxMBConv classes have predefined instances +(wxConvLibc, wxConvFile, wxConvUTF7, wxConvUTF8, wxConvLocal). You can use +these predefined objects directly, or you can instantiate your own objects. -A variable, wxConvCurrent, points to the conversion object that the user interface -is supposed to use, in the case that the user interface is not Unicode-based (like -with GTK+ 1.2). By default, it points to wxConvLibc or wxConvLocal, depending on -which works best on the current platform. +A variable, wxConvCurrent, points to the conversion object that the user +interface is supposed to use, in the case that the user interface is not +Unicode-based (like with GTK+ 1.2). By default, it points to wxConvLibc or +wxConvLocal, depending on which works best on the current platform. \subsection{wxCSConv} @@ -125,7 +124,7 @@ wxCSConv cust(user_encoding); printf("Data: %s\n", (const char*) str.mb_str(cust)); \end{verbatim} -Note: Since mb_str() returns a temporary wxCharBuffer to hold the result +Note: Since mb\_str() returns a temporary wxCharBuffer to hold the result of the conversion, you need to explicitly cast it to const char* if you use it in a vararg context (like with printf). @@ -171,7 +170,7 @@ process_data(tmp_str); \end{verbatim} If a conversion had taken place in cWX2MB (i.e. in a Unicode build), -the buffer will be deallocated as soon as tmp_buf goes out of scope. +the buffer will be deallocated as soon as tmp\_buf goes out of scope. (The macro wxWX2MBbuf reflects the correct return value of cWX2MB (either char* or wxCharBuffer), except for the const.)