Python报错SyntaxError: Non-ASCII character '\xe7' in file
Python报错SyntaxError: Non-ASCII character '\xe7' in file
The Python error "SyntaxError: Non-ASCII character" occurs when using non-supported characters in the code on Windows with the default GBK encoding. Two solutions are provided: adding the encoding format at the top of the Python file or using the UTF-8 mode introduced in Python 3.7. The UTF-8 mode can be enabled by setting the environment variable PYTHONUTF8=1 or using the -Xutf8 command line option.