Closed jakub-deka closed 3 months ago
I suspect you'd see the same error with plain old print?
with open("out.txt", "w") as f:
print("\u2248", file=f)
Add encoding="utf-8"
to your call to open
.
I hope we solved your problem.
If you like using Rich, you might also enjoy Textual
Describe the bug
UnicodeEncodeError when trying to print utf-8 characters despite setting correct encoding env variable on Windows.
To replicate this you can try this.
Conda env has been set up like this:
When running this on my machine I get following error.
Platform
Windows 11 running in conda env.
``` └$ & C:/Users/user/anaconda3/envs/test-env/python.exe -m rich.diagnose ╭─────────────────────────