- //Convert the string
- size_t nActualLength = wxWcstr(buffer, psz, nLen, conv);
-
- if ( !Alloc(nActualLength + 1) )
- {
- wxFAIL_MSG(wxT("Out of memory in wxString"));
- }
- else
- {
- //Copy the data
- assign(buffer.data(), nActualLength);
- }
+ //Do the actual conversion & Set the length of the buffer
+ internalBuffer.SetLength(
+ wxWcstr(internalBuffer, psz, nLen, conv)
+ );