Use the same default encoding to read and write file (Bug #234)
This commit is contained in:
parent
a03a8941c3
commit
6eb5ade55c
|
@ -1,6 +1,7 @@
|
||||||
# Version number followed by the release date
|
# Version number followed by the release date
|
||||||
|
|
||||||
1.2.1.5
|
1.2.1.5
|
||||||
|
* Use the same default encoding to read and write file (Bug #234)
|
||||||
* Only show SSE2 warning in debug build
|
* Only show SSE2 warning in debug build
|
||||||
* Bug #228 Misleading translation when file was changed externally, may lead to data loss
|
* Bug #228 Misleading translation when file was changed externally, may lead to data loss
|
||||||
* Bug #227 Dead Link: Help > Forum
|
* Bug #227 Dead Link: Help > Forum
|
||||||
|
|
|
@ -3139,7 +3139,11 @@ bool MyFrame::openFile ( const wxString &file, bool largeFile )
|
||||||
es.parse ( docBuffer, docBufferLen );
|
es.parse ( docBuffer, docBufferLen );
|
||||||
encoding = es.getEncoding();
|
encoding = es.getEncoding();
|
||||||
if ( encoding.empty() ) // Expat couldn't parse file (e.g. UTF-32)
|
if ( encoding.empty() ) // Expat couldn't parse file (e.g. UTF-32)
|
||||||
|
{
|
||||||
encoding = getApproximateEncoding ( docBuffer, docBufferLen );
|
encoding = getApproximateEncoding ( docBuffer, docBufferLen );
|
||||||
|
if ( encoding.empty() )
|
||||||
|
encoding = "UTF-8";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert buffer if not UTF-8
|
// convert buffer if not UTF-8
|
||||||
|
|
Loading…
Reference in New Issue