Mercurial > octave
diff libgui/src/resource-manager.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 | c20b7290c778 |
children | 0c6dcf803529 0d6795d0373d |
line wrap: on
line diff
--- a/libgui/src/resource-manager.cc Fri Feb 21 09:32:06 2020 +0100 +++ b/libgui/src/resource-manager.cc Fri Feb 21 11:31:45 2020 +0100 @@ -51,6 +51,7 @@ #include "workspace-model.h" #include "file-ops.h" +#include "localcharset-wrapper.h" #include "oct-env.h" #include "defaults.h" @@ -401,8 +402,9 @@ } // Append SYSTEM - codecs->append (QTextCodec::codecForLocale ()->name ().toUpper ().prepend - ("SYSTEM (").append (")")); + codecs->append (QString ("SYSTEM (") + + QString (octave_locale_charset_wrapper ()).toUpper () + + QString (")")); // Clean up and sort list of codecs codecs->removeDuplicates (); @@ -420,7 +422,7 @@ QString enc = current; // Check for valid codec for the default. If this fails, "SYSTEM" (i.e. - // codecForLocale) will be chosen. + // locale_charset) will be chosen. // FIXME: The default is "SYSTEM" on all platforms. So can this fallback // logic be removed completely? bool default_exists = false; @@ -429,8 +431,9 @@ default_exists = true; QString default_enc = - QTextCodec::codecForLocale ()->name ().toUpper ().prepend - ("SYSTEM (").append (")"); + QString ("SYSTEM (") + + QString (octave_locale_charset_wrapper ()).toUpper () + QString (")"); + if (enc.isEmpty ()) { enc = m_settings->value (ed_default_enc).toString ();