[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' ar
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument |
Date: |
Thu, 4 May 2023 07:09:03 -0400 (EDT) |
Follow-up Comment #5, bug #64139 (project octave):
> What I'm looking for is ignoring any BOM, what would be the most robust way
to do so?
You'd probably need to strip the BOM manually.
E.g., in Octave:
ex_str = fileread('example.txt');
if (strncmp(a, char([239, 187, 191]), 3))
ex_str(1:3) = [];
end
Or you could use an external tool to strip the BOM beforehand.
The usage of a BOM in an UTF-8 encoded file is questionable anyway. There is
no byte-order if the surrogates *are* bytes.
Alas, MS chose to add the BOM by default with many of their tools...
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64139>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #64139] character encoding scheme with fileread, Guillaume, 2023/05/03
- [Octave-bug-tracker] [bug #64139] character encoding scheme with fileread, Markus Mützel, 2023/05/03
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, Markus Mützel, 2023/05/03
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, Guillaume, 2023/05/04
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, Markus Mützel, 2023/05/04
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument,
Markus Mützel <=
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, John W. Eaton, 2023/05/04
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, Guillaume, 2023/05/04
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, Guillaume, 2023/05/05
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, Markus Mützel, 2023/05/05
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, Markus Mützel, 2023/05/05
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, Markus Mützel, 2023/05/05
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, Markus Mützel, 2023/05/06
- [Octave-bug-tracker] [bug #64139] fileread doesn't support 'encoding' argument, Markus Mützel, 2023/05/09