I am on windows system.
I created two utf-8 file python_print.py for python and perl_print.pl for perl respectively, the two files contains same line as below
print("中")
and perl has ; delimiter.
My CMD is in code page 936 by default, and I run
python python_print.py
I got
中
However, when I run
perl perl_print.pl
for the first time, it gives
涓
running it for the second time, I got
why??
I continue testing, I run chcp 65001 to change cmd encoding to utf-8, and this time, both python and perl gives correct "中".
Now I am completely confused, it seems that print in python and perl are quite different. It seems that perl alway print out utf8 bytes? and python print can detect CMD code page to print correct byte? Can somebody explain my test result?
