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:
@@ -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
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user