- // nothing to do here (necessary for Darwin linking probably)
-}
-
-const wxWCharBuffer wxMBConv::cMB2WC(const char *psz) const
-{
- if ( psz )
+ // although new conversion classes are supposed to implement this function
+ // directly, the existins ones only implement the old MB2WC() and so, to
+ // avoid to have to rewrite all conversion classes at once, we provide a
+ // default (but not efficient) implementation of this one in terms of the
+ // old function by copying the input to ensure that it's NUL-terminated and
+ // then using MB2WC() to convert it
+
+ // the number of chars [which would be] written to dst [if it were not NULL]
+ size_t dstWritten = 0;
+
+ // the number of NULs terminating this string
+ size_t nulLen = 0; // not really needed, but just to avoid warnings
+
+ // if we were not given the input size we just have to assume that the
+ // string is properly terminated as we have no way of knowing how long it
+ // is anyhow, but if we do have the size check whether there are enough
+ // NULs at the end
+ wxCharBuffer bufTmp;
+ const char *srcEnd;
+ if ( srcLen != wxNO_LEN )