I am experiencing a problem when trying to print chinese characters in VSCODE using python. the characters are not coming correctly. Please see the output. Please help.
My encoding is selected as UTF-8 already. Python version : 3.12 VS
code version : 1.92.1 OS : Windows NTX64 10.0.19045
data = "中國哲學書電子化計劃"
print(data)
Output : ������Ǯѹq�l�ƭp��
2
Answers
What’s about your terminal(system) encoding?
This mean your .py file in utf encoding.
Try terminal command
Also check this: How can I use Unicode characters on the Windows command line?
You can activate UTF-8 for worldwide language support in Control Panel-Languages and Region:
Inbasu’s answer
chcp 65001
would do the trick aswell.