]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxConvAuto() in wxStyledTextCtrl::DoLoadFile().
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 7 Jul 2013 11:47:17 +0000 (11:47 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 7 Jul 2013 11:47:17 +0000 (11:47 +0000)
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

src/stc/stc.cpp
src/stc/stc.cpp.in

index 64c3c3fd4542c4ed16ae29eb0958c7f763ef2e34..1dc93c27de4543e43a61798ab831bc3a2533b3ba 100644 (file)
@@ -4433,7 +4433,7 @@ wxStyledTextCtrl::DoLoadFile(const wxString& filename, int WXUNUSED(fileType))
     if ( file.IsOpened() )
     {
         wxString text;
     if ( file.IsOpened() )
     {
         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
             // much we can do if the file uses inconsistent EOLs anyhow, we'd
         {
             // 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
index f407276bbf17e0ba9fa9a85d5927e7ae689da3ff..a635b561df4db6fea589bba5b8766502e777040a 100644 (file)
@@ -571,7 +571,7 @@ wxStyledTextCtrl::DoLoadFile(const wxString& filename, int WXUNUSED(fileType))
     if ( file.IsOpened() )
     {
         wxString text;
     if ( file.IsOpened() )
     {
         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
             // much we can do if the file uses inconsistent EOLs anyhow, we'd
         {
             // 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