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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a5f2-2c212.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a5f2-2c212.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?