Skip to content
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

[Bug?] The Python Received Output will display Chinese as gibberish when without Use Unicode UTF-8 for worldwide language support in windows #434

Open
H2Sxxa opened this issue May 9, 2024 · 0 comments

Comments

@H2Sxxa
Copy link

H2Sxxa commented May 9, 2024

Extension Version: v6.1.0

VS Code Version: 1.89.0

Browser Version:

Operating System: Windows 11 x64

Python Version: 3.11.4

Description

Hi, CPH is really an excellent plugin, but it can't work well on my computer in some situations.

I have read the #338 and the problem seems to only happen in Python, I think it's better to open a new issue.

I don't know how to program in TypeScript, but I think we can provide a custom output encoding in the extension settings.

Here is some relevant information, thanks to the patient.

Use Unicode UTF-8 for worldwide language support

Control Panel > Clock and Region > Region > Administrative tab > Change system locale button > Beta:Use Unicode UTF-8 for worldwide language support.

Code

print("你好")

Test without UTF-8

without utf-8

Test with UTF-8

with utf-8

Test with custom TextIOWrapper and without UTF-8

from io import TextIOWrapper
import sys

sys.stdout = TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
print("你好")

with custom TextIOWrapper

Test with declear # coding:gbk and without utf-8

image

@H2Sxxa H2Sxxa changed the title [Bug?] The Python Received Output will display Chinese as gibberish when without Use Unicode UTF-8 for worldwide language support in windows [Bug?] The Python Received Output will display Chinese as gibberish when without Use Unicode UTF-8 for worldwide language support in windows May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant