Mercurial > octave
changeset 29120:eb6599cf2db5
Use UTF-8 encoding for .m files by default (bug #59387).
* libinterp/corefcn/input.cc (input_system): Set default .m file encoding to
UTF-8.
* libgui/src/m-editor/file-editor-tab.cc (file_editor_tab),
libgui/src/gui-preferences-ed.h: Set default encoding for editor to UTF-8.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Thu, 12 Nov 2020 18:15:52 +0100 |
parents | 9d25ef0db8a5 |
children | 54509b7fddd3 |
files | libgui/src/gui-preferences-ed.h libgui/src/m-editor/file-editor-tab.cc libinterp/corefcn/input.cc |
diffstat | 3 files changed, 3 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/gui-preferences-ed.h Sat Nov 28 15:38:34 2020 +0100 +++ b/libgui/src/gui-preferences-ed.h Thu Nov 12 18:15:52 2020 +0100 @@ -238,10 +238,7 @@ ed_show_dbg_file ("editor/show_dbg_file", QVariant (true)); const gui_pref -ed_default_enc ("editor/default_encoding", - QVariant (QString ("SYSTEM (") + - QString (octave_locale_charset_wrapper ()).toUpper () + - QString (")"))); +ed_default_enc ("editor/default_encoding", QVariant ("UTF-8")); const gui_pref ed_create_new_file ("editor/create_new_file", QVariant (false));
--- a/libgui/src/m-editor/file-editor-tab.cc Sat Nov 28 15:38:34 2020 +0100 +++ b/libgui/src/m-editor/file-editor-tab.cc Thu Nov 12 18:15:52 2020 +0100 @@ -266,10 +266,7 @@ notice_settings (settings, true); // encoding, not updated with the settings - QString locale_enc_name = - QString ("SYSTEM (") + - QString (octave_locale_charset_wrapper ()).toUpper () + QString (")"); - m_encoding = settings->value (ed_default_enc.key, locale_enc_name).toString (); + m_encoding = settings->value (ed_default_enc.key, "UTF-8").toString (); m_enc_indicator->setText (m_encoding); // no changes in encoding yet m_new_encoding = m_encoding;
--- a/libinterp/corefcn/input.cc Sat Nov 28 15:38:34 2020 +0100 +++ b/libinterp/corefcn/input.cc Thu Nov 12 18:15:52 2020 +0100 @@ -410,7 +410,7 @@ input_system::input_system (interpreter& interp) : m_interpreter (interp), m_PS1 (R"(octave:\#> )"), m_PS2 ("> "), m_completion_append_char (' '), m_gud_mode (false), - m_mfile_encoding ("system"), m_auto_repeat_debug_command (true), + m_mfile_encoding ("utf-8"), m_auto_repeat_debug_command (true), m_last_debugging_command ("\n"), m_input_event_hook_functions (), m_initialized (false) { }