- for ( wxFileConfigLineList *p = m_linesHead; p != NULL; p = p->Next() ) {
- if ( !file.Write(p->Text() + wxTextFile::GetEOL()) ) {
+ for ( wxFileConfigLineList *p = m_linesHead; p != NULL; p = p->Next() )
+ {
+ wxString line = p->Text();
+ line += wxTextFile::GetEOL();
+#if wxUSE_UNICODE
+ wxCharBuffer buf = wxConvLocal.cWX2MB( line );
+ if ( !file.Write( (const char*)buf, strlen( (const char*) buf ) ) )
+#else
+ if ( !file.Write( line.c_str(), line.Len() ) )
+#endif
+ {