-#if wxUSE_UNICODE
- const wxWX2MBbuf buf = string.mb_str();
- m_output->Write(buf, string.Len());
+ for (size_t i = 0; i < string.Len(); i++)
+ {
+ wxChar c = string[i];
+ if (c == T('\n'))
+ {
+#if defined(__WINDOWS__)
+ c = T('\r');
+ m_output->Write( (const void*)(&c), sizeof(wxChar) );
+ c = T('\n');
+ m_output->Write( (const void*)(&c), sizeof(wxChar) );
+#elif defined(__UNIX__)
+ c = T('\n');
+ m_output->Write( (const void*)(&c), sizeof(wxChar) );
+#elif defined(__WXMAC__)
+ c = T('\r');
+ m_output->Write( (const void*)(&c), sizeof(wxChar) );
+#elif defined(__OS2__)
+ c = T('\r');
+ m_output->Write( (const void*)(&c), sizeof(wxChar) );
+ c = T('\n');
+ m_output->Write( (const void*)(&c), sizeof(wxChar) );