bugGNU Octave - Bugs: bug #59560, HZ encoded files are not correctly...


bug #59560: HZ encoded files are not correctly read

Submitted by:  Markus Mützel <mmuetzel>
Submitted on:  Fri 27 Nov 2020 01:58:50 PM UTC
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


Fri 27 Nov 2020 01:58:50 PM UTC, original submission:  

As reported on discourse [1], files that are saved with Octave's editor encoded in HZ-GB-2312 [2] lead to a syntax error on execution (when they start with an ASCII character which a valid .m file always needs to).

Steps to reproduce with the attached file:

>> __mfile_encoding__ ('HZ-GB-2312')
>> test_hz_gb_2312
parse error near line 1 of file D:\SVN\Octave\test_hz_gb_2312.m

  syntax error

>>> ?}1;

I'm not sure if the error is on encoding (i.e. the file shouldn't start with "~}" [0x7E 0x7D] in the first place) or on decoding the file.

[1]: https://octave.discourse.group/t/no-text-on-script-syntax-error/465
[2]: https://en.wikipedia.org/wiki/HZ_(character_encoding)

Markus Mützel <mmuetzel>
Project Member


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

Attach Files:

Attached Files
file #51667:  numerical.m added by hakimi_5729 (7KiB - application/octet-stream)
file #50354:  test_hz_gb_2312.m added by mmuetzel (6B - text/plain)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by hakimi_5729 (Updated the item)
  • -email is unavailable- added by mmuetzel (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 project members can vote.





    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-07-16 hakimi_5729 Attached File- => Added numerical.m, #51667
    2020-11-27 mmuetzel Attached File- => Added test_hz_gb_2312.m, #50354

    Back to the top

    Powered by Savane 3.9