[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63930] fprintf problem
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #63930] fprintf problem |
Date: |
Thu, 16 Mar 2023 09:33:03 -0400 (EDT) |
Follow-up Comment #6, bug #63930 (project octave):
Thanks.
The encoding of the strings is actually converted twice.
1. When parsing the .m file, the entire file is converted from codepage 1252
to UTF-8. (That is done so that Octave can potentially feed those strings to
other libraries, like for regex matching or printing text in figures.)
2. When writing to the file, each character array is converted from UTF-8 to
the target encoding. That is either the one specified when opening the file
(with `fopen`), or, if none is specified, the encoding that is used for
parsing .m files (the encoding returned by `__mfile_encoding__`). That was
done to be compatible with Matlab.
I'm guessing that something might be going wrong in the second conversion if
the output is buffered, and the buffer is flushed when the end of it happens
to be "between" bytes of a multi-byte UTF-8 character...
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63930>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63930] fprintf problem, Charles Praplan, 2023/03/15
- [Octave-bug-tracker] [bug #63930] fprintf problem, Dmitri A. Sergatskov, 2023/03/15
- [Octave-bug-tracker] [bug #63930] fprintf problem, PRIYANSHU SHUKLA, 2023/03/15
- Message not available
- [Octave-bug-tracker] [bug #63930] fprintf problem, Dmitri A. Sergatskov, 2023/03/15
- [Octave-bug-tracker] [bug #63930] fprintf problem, Markus Mützel, 2023/03/16
- [Octave-bug-tracker] [bug #63930] fprintf problem, Charles Praplan, 2023/03/16
- [Octave-bug-tracker] [bug #63930] fprintf problem,
Markus Mützel <=
- [Octave-bug-tracker] [bug #63930] fprintf problem, Charles Praplan, 2023/03/16
- [Octave-bug-tracker] [bug #63930] fprintf problem, Charles Praplan, 2023/03/18
- [Octave-bug-tracker] [bug #63930] fprintf problem, Charles Praplan, 2023/03/18
- [Octave-bug-tracker] [bug #63930] fprintf problem, Charles Praplan, 2023/03/19
- [Octave-bug-tracker] [bug #63930] fprintf problem, Dmitri A. Sergatskov, 2023/03/19
- [Octave-bug-tracker] [bug #63930] fprintf problem, Dmitri A. Sergatskov, 2023/03/19
- [Octave-bug-tracker] [bug #63930] fprintf problem, Charles Praplan, 2023/03/19
- [Octave-bug-tracker] [bug #63930] fprintf problem, Dmitri A. Sergatskov, 2023/03/19
- [Octave-bug-tracker] [bug #63930] fprintf problem, Arun Giridhar, 2023/03/20
- [Octave-bug-tracker] [bug #63930] fprintf problem, Arun Giridhar, 2023/03/24