- // chunk successfully converted, go to the next one
- in += wxWcslen(in) + 1 /* skip NUL too */;
- lenBuf = lenBufNew + 1;
+ return wxCharBuffer();
+}
+
+const wxWCharBuffer
+wxMBConv::cMB2WC(const char *in, size_t inLen, size_t *outLen) const
+{
+ const size_t dstLen = ToWChar(NULL, 0, in, inLen);
+ if ( dstLen != wxCONV_FAILED )
+ {
+ wxWCharBuffer wbuf(dstLen);
+ if ( ToWChar(wbuf.data(), dstLen, in, inLen) )
+ {
+ if ( outLen )
+ *outLen = dstLen;
+ return wbuf;
+ }
+ }
+
+ if ( outLen )
+ *outLen = 0;
+
+ return wxWCharBuffer();
+}
+
+const wxCharBuffer
+wxMBConv::cWC2MB(const wchar_t *in, size_t inLen, size_t *outLen) const
+{
+ const size_t dstLen = FromWChar(NULL, 0, in, inLen);
+ if ( dstLen != wxCONV_FAILED )
+ {
+ wxCharBuffer buf(dstLen);
+ if ( FromWChar(buf.data(), dstLen, in, inLen) )
+ {
+ if ( outLen )
+ *outLen = dstLen;
+ return buf;
+ }