bugGNU Octave - Bugs: bug #62767, GUI editor could open files in...


bug #62767: GUI editor could open files in encoding specific to directory

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Thu 14 Jul 2022 02:45:53 PM UTC
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Thu 14 Jul 2022 02:45:53 PM UTC, original submission:  

If a directory contains a `.oct-config` file that specifies an encoding that is different from the default .m file encoding, the editor still tries to open files in that directory with the default encoding. That might lead to garbled characters in the displayed file.

See also: https://github.com/catch22/octave-doctest/pull/256#issuecomment-1183671829

I'm attaching a work-in-progress patch for that.
With it, files open in the encoding specified with `dir_encoding` or in the `.oct-config` file if it is already in the load path.

The `.oct-config` parsing logic is coupled to the load path (to take advantage of caching). That means that files from directories that aren't in the load path are opened with the default encoding even if their directory contains a `.oct-config` file.
Imho, that might be an ok trade off for performance.

Another thing that I noticed: If I leave one of those files with differing encoding open in the editor and close Octave, they are displayed with the default encoding (i.e., with garbled characters) the next time I open Octave.

@ttl: Do you know if it is possible to store the encoding for open files in the editor on a per tab basis?

Markus Mützel <mmuetzel>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Submitted the item)
  • -email is unavailable- added by mmuetzel

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-07-14 mmuetzel Attached File- Added wip-file-editor-with-dir_encoding.patch, #53438
        Carbon-Copy- Added ttl

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code