[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.m files |
Date: |
Fri, 29 Nov 2019 07:39:02 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0 |
Follow-up Comment #5, bug #57304 (project octave):
The following works for me with Octave 5.1:
regexp (native2unicode (uint8 (fileread ("angstrom.m")), "iso-8859-1"),
"Hello")
I hope this still works in Octave 6.
The crucial part might be this sentence in the documentation of
native2unicode:
> If native_bytes is a string vector, it is returned as is.
With Octave 6, it should also be possible to specify the encoding when opening
the file. But I can't try at the moment:
fid = fopen ("angstrom.m", "r", "n", "iso-8859-1");
regexp (char (fread (fid).'), "Hello")
fclose (fid);
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57304>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.m files, Guillaume, 2019/11/26
- [Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.m files, Markus Mützel, 2019/11/26
- [Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.m files, Guillaume, 2019/11/27
- [Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.m files, Markus Mützel, 2019/11/27
- [Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.m files, Guillaume, 2019/11/29
- [Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.m files,
Markus Mützel <=
- [Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.m files, Guillaume, 2019/11/29
- [Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.m files, Markus Mützel, 2019/11/29
- [Octave-bug-tracker] [bug #57304] Error message for non-UTF-8 encoded *.m files, Guillaume, 2019/11/29