diff libgui/src/m-editor/file-editor-tab.cc @ 28118:f2789cae04f3 stable

Don't use "codecForLocale" to get encoding for locale charset. * ligui/src/gui-preferences-ed.h, libgui/src/qt-interpreter-events.cc (qt_interpreter_events::gui_preference_adjust), libgui/src/resource-manager.cc (resource_manager::get_codecs), libgui/src/m-editor/file-editor-tab.cc (file_editor_tab): "codecForLocal" is overridden in octave-qobject.cc (base_qobject). Use "octave_locale_charset_wrapper" instead to query the name of the encoding for the locale charset.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 21 Feb 2020 11:31:45 +0100
parents ab22056e8c1f
children 4cfe24f56336 1127bcb30e61
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Fri Feb 21 09:32:06 2020 +0100
+++ b/libgui/src/m-editor/file-editor-tab.cc	Fri Feb 21 11:31:45 2020 +0100
@@ -74,6 +74,7 @@
 
 #include "cmd-edit.h"
 #include "file-ops.h"
+#include "localcharset-wrapper.h"
 #include "uniconv-wrappers.h"
 
 #include "bp-table.h"
@@ -266,7 +267,8 @@
 
     // encoding, not updated with the settings
     QString locale_enc_name =
-      QTextCodec::codecForLocale ()->name ().toUpper ().prepend ("SYSTEM (").append (")");
+      QString ("SYSTEM (") +
+      QString (octave_locale_charset_wrapper ()).toUpper () + QString (")");
     m_encoding = settings->value (ed_default_enc.key, locale_enc_name).toString ();
     m_enc_indicator->setText (m_encoding);
     // no changes in encoding yet