When I try to redirect a UTF-8 stdout in Powershell by running python3 .\test.py > test.txt
, error occurs :
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-1: character maps to <undefined>
The code in test.py
are as following and that is encoded by UTF-8.
print("\u2714")
The code is uploaded here.https://github.com/lingsongfeng/pytest