UTF-8 characters sometimes displaying, sometimes not
I've got kind of a weird issue. I have a program that works with Chinese characters. The characters show in the terminal no problem most of the time (I have os.system('chcp 65001") in the first line of the program, but occasionally they show as either blank or boxes, just as I might expect with the wrong encoding. Any idea what's going on there?
EDIT: I've tried this to see if it has to do with the chcp command:
while true:
os.system('chcp 65001')
print('你好')
time.sleep(0.5)
Still no good, so it doesn't seem to have to do with the chcp command. All I get is blank lines.
Posted Oct 28, 2017, 9:40 AM UTC · edited
212