git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33098
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- strTmp.append(wxConvertMB2WX(buf), inStream.LastRead());
+ // FIXME: this is broken because if we have part of multibyte
+ // character in the buffer (and another part hasn't been
+ // read yet) we're going to lose data because of conversion
+ // errors
+ buf[inStream.LastRead()] = '\0';
+ strTmp += conv.cMB2WX(buf);
}
while ( !inStream.Eof() );
}
while ( !inStream.Eof() );
{
wxString line = p->Text();
line += wxTextFile::GetEOL();
{
wxString line = p->Text();
line += wxTextFile::GetEOL();
- if ( !os.Write(line.mb_str(conv), line.length()) )
+
+ wxCharBuffer buf(line.mb_str(conv));
+ if ( !os.Write(buf, strlen(buf)) )
{
wxLogError(_("Error saving user configuration data."));
{
wxLogError(_("Error saving user configuration data."));