bugGNU Octave - Bugs: bug #62808, dir_encoding: clarify docs about...


bug #62808: dir_encoding: clarify docs about deleting and global encoding

Submitter:  Colin Macdonald <cbm>
Submitted:  Sun 24 Jul 2022 11:31:00 PM UTC
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
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

Sun 24 Jul 2022 11:31:00 PM UTC, original submission:  

"help dir_encoding":

>     The NEW_ENCODING input must be a valid encoding identifier or
>     "delete".  In the latter case, any per-directory encoding is
>     removed and the (globally set) m-file encoding will be used for the
>     given DIR.

1.  perhaps this should reference how to query that default globally set encoding.  Is that "@pref{__mfile_encoding__}"?  Am I right there is not yet a no public way to query this?  (Well, ... `dir_encoding("/hello_Im_not_a_real_path")` ...  but ick?)

2.  Does this adequately explain that deleting is "temporary" in the sense that revisiting a directory can change the encoding?

>> d = "/home/cbm/src/octave-doctest.git/test_extra/test_encoding"
d = /home/cbm/src/octave-doctest.git/test_extra/test_encoding
>> s = dir_encoding (d)
s = utf-8
>> cd (d)
>> cd ..
>> s = dir_encoding (d)
s = windows-1252
>> dir_encoding(d, "delete")
>> s = dir_encoding (d)
s = utf-8
>> cd (d)
>> cd ..
>> s = dir_encoding (d)
s = windows-1252

Similarly one can chance the encoding in the DB and have it reset by changing to the directory:
>> dir_encoding (d, "windows-1253")
>> s = dir_encoding (d)
s = windows-1253
>> cd (d)                  # <--- note this resets it
>> s = dir_encoding (d)    # back to windows-1252
s = windows-1252

Maybe we can say:

> Note that changing or deleting the encoding is transient and may be refreshed by the contents of a @code{.oct-config} file if DIR is added to the load path (e.g., by changing the current working directory or manipulating the path).

Colin Macdonald <cbm>


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    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.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-c373.
    Corresponding source code