diff --git a/ChangeLog b/ChangeLog index cb0f702..e609908 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ # Version number followed by the release date 1.2.1.5 + * Use the same default encoding to read and write file (Bug #234) * Only show SSE2 warning in debug build * Bug #228 Misleading translation when file was changed externally, may lead to data loss * Bug #227 Dead Link: Help > Forum diff --git a/src/xmlcopyeditor.cpp b/src/xmlcopyeditor.cpp index af58997..46a6bb2 100644 --- a/src/xmlcopyeditor.cpp +++ b/src/xmlcopyeditor.cpp @@ -3139,7 +3139,11 @@ bool MyFrame::openFile ( const wxString &file, bool largeFile ) es.parse ( docBuffer, docBufferLen ); encoding = es.getEncoding(); if ( encoding.empty() ) // Expat couldn't parse file (e.g. UTF-32) + { encoding = getApproximateEncoding ( docBuffer, docBufferLen ); + if ( encoding.empty() ) + encoding = "UTF-8"; + } } // convert buffer if not UTF-8