Python 3.4 command line print Chinese, there will be an extra line of garbled code.

windows environment, command line coding has been changed to utf-8 65001 python file format to utf-8,. Printing is normal in pycharm environment.

Code
S1 = "Learning"
print (S1)
print (s1.encode ("utf-8"))
print (" Test")

the command line is displayed as

clipboard.png

is a square with 2 more line breaks

Aug.17,2021

this should be a coding problem for your command line tool.


it's possible that your Windows command line tool parses newline characters into unrecognized squares. Normal parsing should be a direct line break

Menu