-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
engine.eval without assigned stdout does not handle Unicode correctly #34
Comments
Just tested with R2023b and matlabengine 23.2.1, and the bug remains. @alanfmw, not sure whether these issues are actually monitored? |
@allefeld, we will look into this. |
Are there any news on this? |
R2024a contains a fix. On Linux and Mac, with UTF-8 display, you will now see the Unicode character displayed correctly. On Windows, it depends on the machine locale. On a Chinese machine, we saw the Unicode output written to the Windows console correctly, but on a US machine, the Unicode output to the Windows console was swallowed, and changing the code page with |
Great, I'll check it out! I'm on Linux, Debian 12.5. Edit: Can confirm it is fixed with R2024a on Linux. |
Example: The Unicode character '→' (U+2192) appears in the output as U+001A.
That does not happen if the stdout argument is assigned to a
StringIO
instance.However, the disadvantage is that output assigned to stdout is heavily buffered. If I have a long-running computation which continuously produces output, I have to choose between proper Unicode output and immediate feedback.
I though this might be a property of
StringIO
, and tried to interceptwrite
calls.But from the result it is clear that
stdout.write
is only called once. I also tried to induce flushing by inserting newline characters in the output, with no success.The text was updated successfully, but these errors were encountered: