X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..917be7ed065337e8a7a67615969ecaade9eea809:/docs/latex/wx/mbconv.tex?ds=sidebyside diff --git a/docs/latex/wx/mbconv.tex b/docs/latex/wx/mbconv.tex index 5aaf60b65c..3d5e4a07b4 100644 --- a/docs/latex/wx/mbconv.tex +++ b/docs/latex/wx/mbconv.tex @@ -35,17 +35,43 @@ Constructor. \membersection{wxMBConv::MB2WC}\label{wxmbconvmb2wc} -\constfunc{virtual size\_t}{MB2WC}{\param{wchar\_t* }{buf}, \param{const char* }{psz}, \param{size\_t }{n}} +\constfunc{virtual size\_t}{MB2WC}{\param{wchar\_t *}{outputBuf}, \param{const char *}{psz}, \param{size\_t }{outputSize}} -Converts from multibyte encoding to Unicode, using the libc routine mbstowcs() -(this is overridden by derived classes). Returns the size of the destination buffer. +Converts from a string {\it psz} in multibyte encoding to Unicode putting the +output into the buffer {\it outputBuf} of the maximum size {\it outputSize} (in wide +characters, not bytes). If {\it outputBuf} is {\tt NULL}, only the length of the +string which would result from the conversion is calculated and returned. +Note that this is the length and not size, i.e. the returned value does +{\bf not} include the trailing NUL. But when the function is called with a +non-{\tt NULL} {\it outputBuf}, the {\it outputSize} parameter should be the size of the buffer +and so it {\bf should} take into account the trailing NUL. + +\wxheading{Parameters} + +\docparam{outputBuf}{the output buffer, may be {\tt NULL} if the caller is only +interested in the length of the resulting string} + +\docparam{psz}{the {\tt NUL}-terminated input string, cannot be {\tt NULL}} + +\docparam{outputSize}{the size of the output buffer (in wide characters, {\bf including} the +NUL) , ignored if {\it outputBuf} is {\tt NULL}} + +\wxheading{Return value} + +The length of the converted string (in wide characters, {\bf excluding} the NUL) \membersection{wxMBConv::WC2MB}\label{wxmbconvwc2mb} \constfunc{virtual size\_t}{WC2MB}{\param{char* }{buf}, \param{const wchar\_t* }{psz}, \param{size\_t }{n}} -Converts from Unicode to multibyte encoding, using the libc routine wcstombs() -(this is overridden by derived classes). Returns the size of the destination buffer. +Converts from Unicode to multibyte encoding. The semantics of this function +(including the return value meaning) is the same as for +\helpref{MB2WC}{wxmbconvmb2wc}. + +Notice that when the function is called with a non-{\tt NULL} buffer, the +{\it n} parameter should be the size of the buffer and so it {\bf should} take +into account the trailing NUL, which might take two or four bytes for some +encodings (UTF-16 and UTF-32). \membersection{wxMBConv::cMB2WC}\label{wxmbconvcmb2wc}