-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Unicode characters not rendering correctly #6136
Comments
This feels more like... hmm We've got a bunch of validation that Terminal and Console properly buffer UTF-8 when it comes in. This sound suspiciously like #386, which ended up being a CMD issue. Is this a Python issue? I found PEP-0528, which discusses getting UTF-8 out of Python onto the console. Of note: if you run it under WSL, it is beautiful. Same library, same terminal, different cpython runtime. 😄 |
Very curious. I've discovered that if I write the output to a file rather than to the terminal, and the use the But if I then open the same file in Python and write it to stdout, the issue appears. But only if I do the write in a single chunk. If I write in smaller chunks then it's fine. I tried this on Python 3.8.1, 3.8.3, 3.9.0a6 and all had the same problem. So it's clearly related to Python, but quite where the fault lies I'm not sure! Let me know if there is anything I can do to help you diagnose. I could send you the output from the color table if that helps. |
So, I'm also unsure of how to proceed. I think the best way forward would be a bug filed on cpython (bugs.python.org). I'm concerned about their buffering, given your remark about doing the write in a single chunk. 😄 There's a bit of stuff here- I'm gonna close this one out as, perhaps, something we don't have too much control over. |
BINGO! |
Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report! |
Environment
Microsoft Windows [Version 10.0.18363.720]
Terminal v1.0.1401.0
(It's a VM if that makes a difference)
Steps to reproduce
Install Rich python library (https://github.com/willmcgugan/rich), and run the following:
Expected behavior
Unicode box characters should render normally. The same output works with OSX / Linux.
Actual behavior
You should see broken unicode characters in the middle of the tables. Here are some examples:
If I was to hazard a guess I'd say that the utf-8 has been split over some internal buffer, and a multi-byte character was truncated at the boundary.
The text was updated successfully, but these errors were encountered: