static wxString FromUTF8(const char *utf8)
{ return wxString(wxConvUTF8.cMB2WC(utf8)); }
static wxString FromUTF8(const char *utf8, size_t len)
- { return wxString(wxConvUTF8.cMB2WC(utf8, len == npos ? wxNO_LEN : len)); }
+ {
+ size_t wlen;
+ wxWCharBuffer buf(wxConvUTF8.cMB2WC(utf8, len == npos ? wxNO_LEN : len, &wlen));
+ return wxString(buf.data(), wlen);
+ }
const wxCharBuffer utf8_str() const { return wxConvUTF8.cWC2MB(wc_str()); }
const wxCharBuffer ToUTF8() const { return utf8_str(); }
#endif