在test.py我有
print('?????? ???')
Run Code Online (Sandbox Code Playgroud)
与cmd正常工作
> python test.py
?????? ???
Run Code Online (Sandbox Code Playgroud)
使用Git Bash出错
$ python test.py
Traceback (most recent call last):
File "test.py", line 2, in <module>
print('\u041f\u0440\u0438\u0432\u0435\u0442 \u043c\u0438\u0440')
File "C:\Users\raksa\AppData\Local\Programs\Python\Python36\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-5: character maps to <undefined>
Run Code Online (Sandbox Code Playgroud)
有谁知道通过Git Bash执行 python 代码时出错的原因?