[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62767] GUI editor could open files in encodin

From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #62767] GUI editor could open files in encoding specific to directory
Date: Thu, 14 Jul 2022 10:45:54 -0400 (EDT)


                 Summary: GUI editor could open files in encoding specific to
                 Project: GNU Octave
               Submitter: mmuetzel
               Submitted: Thu 14 Jul 2022 04:45:53 PM CEST
                Category: GUI
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Feature Request
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any


Follow-up Comments:

Date: Thu 14 Jul 2022 04:45:53 PM CEST By: Markus Mützel <mmuetzel>
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:

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?

File Attachments:

Date: Thu 14 Jul 2022 04:45:53 PM CEST  Name:
wip-file-editor-with-dir_encoding.patch  Size: 3KiB   By: mmuetzel



Reply to this item at:


Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]