[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) |
URL:
<https://savannah.gnu.org/bugs/?62767>
Summary: GUI editor could open files in encoding specific to
directory
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:
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?
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 14 Jul 2022 04:45:53 PM CEST Name:
wip-file-editor-with-dir_encoding.patch Size: 3KiB By: mmuetzel
<http://savannah.gnu.org/bugs/download.php?file_id=53438>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62767>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #62767] GUI editor could open files in encoding specific to directory,
Markus Mützel <=