Use wxConvAuto() in wxStyledTextCtrl::DoLoadFile().

This is both more reasonable than the current runtime encoding (the
input file is from unknown source) and more robust (it can handle UTF-*
encoded files transparently).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2013-07-07 11:47:17 +00:00
parent f8c2c6f24d
commit e7b6bef7c5
2 changed files with 2 additions and 2 deletions

View File

@@ -4433,7 +4433,7 @@ wxStyledTextCtrl::DoLoadFile(const wxString& filename, int WXUNUSED(fileType))
if ( file.IsOpened() ) if ( file.IsOpened() )
{ {
wxString text; wxString text;
if ( file.ReadAll(&text, *wxConvCurrent) ) if ( file.ReadAll(&text, wxConvAuto()) )
{ {
// Detect the EOL: we use just the first line because there is not // Detect the EOL: we use just the first line because there is not
// much we can do if the file uses inconsistent EOLs anyhow, we'd // much we can do if the file uses inconsistent EOLs anyhow, we'd

View File

@@ -571,7 +571,7 @@ wxStyledTextCtrl::DoLoadFile(const wxString& filename, int WXUNUSED(fileType))
if ( file.IsOpened() ) if ( file.IsOpened() )
{ {
wxString text; wxString text;
if ( file.ReadAll(&text, *wxConvCurrent) ) if ( file.ReadAll(&text, wxConvAuto()) )
{ {
// Detect the EOL: we use just the first line because there is not // Detect the EOL: we use just the first line because there is not
// much we can do if the file uses inconsistent EOLs anyhow, we'd // much we can do if the file uses inconsistent EOLs anyhow, we'd