- //do the actual conversion (if it fails we get an empty string)
- (*this) = wxMbstr(pwz, nLen, conv);
+ //Create a wxStringBufferLength which will access the internal
+ //C char pointer in non-stl mode
+ wxStringBufferLength internalBuffer(*this, wxString::WorstEncodingCase(nLen, conv) + 1);
+
+ //Do the actual conversion & Set the length of the buffer
+ internalBuffer.SetLength(
+ wxMbstr(internalBuffer, pwz, nLen, conv)
+ );