Encoding code page on gui editor on windows

On octave-gui in the Japanese environment, the editor’s encoding is ANSI (code page 932). However, in the current situation utf-8 without BOM is a popular encoding even on Windows. Please consider implementing the setting code page option in the editor.

The built-in editor uses the same encoding that is used to interpret .m files by default. You can change that encoding in the editor preferences:

In older versions, the default setting was the system encoding. In newer versions, the default setting is UTF-8 (on all platforms).
IIUC, the setting doesn’t change on an update. I.e., if you updated from an older version of Octave that still used the system encoding, you’ll continue using it (until you change it manually or delete the preferences .ini file). On “fresh” installations, the new default will be used.

Slightly off-topic: If you can’t convert all your .m files to UTF-8 for some reason, you can select a differing encoding on a per-folder level. For this, you could create a file named .oct-config in the respective folders with the following content:

encoding=windows-932

Or whatever encoding identifier you were using when creating the .m files in that folder. (Maybe check with __locale_charset__ if the encoding was set to SYSTEM.)

1 Like

I overlooked the preference items.
Thank you for your detailed descriptions.