anon...@sunsite.dk wrote:
> + // actual conversion for strings with embedded null characters
> + //
> + // outputSize is the size of the output buffer
> + // pszLen is the length of the input string (including all but
> last null character)
> + size_t MB2WC(wchar_t *outputBuf, const
> char *psz, size_t outputSize, size_t pszLen) const;
> + size_t
> WC2MB(char *outputBuf, const wchar_t *psz, size_t outputSize,
> size_t pszLen) const;
much better, thanks! There's a problem, though: the way you did this
(using same name for virtual MB2WC overriden in derived classes and
nonvirtual MB2WC that ignores allows embedded NULLs) causes name
hiding, so you can't call the newly added methods of on object of
derived class. This works:
wxMBConv conv;
conv.WC2MB(out, psz, outsz, pszlen);
but this doesn't:
wxCSConv conv("iso-8859-1");
conv.WC2MB(out, psz, outsz, pszlen);
The solution is simple: use a different name. See here for more
details: http://cpptips.hyperformix.com/cpptips/virt_name_hide
Regards,
Vaclav
--
PGP key: 0x465264C9, available from http://pgp.mit.edu/