3 ms·
Just to elaborate, on a fresh Windows 7 install with en_CA locale, this was the behaviour: python3 -c 'print("é")' é python3 -c 'print("é")' > out.txt
by slavik81 7y ago
Just to elaborate, on a fresh Windows 7 install with en_CA locale, this was the behaviour:
python3 -c 'print("é")'
é
python3 -c 'print("é")' > out.txt
(UnicodeEncodeError) 'ascii' codec can't encode character '\xe9' in position 1: ordinal not in range(128)
I felt that was unacceptable behaviour for my program, but it was beyond my ability to fix. Though, I think this has been addressed in more recent Python releases.
- mehrdadn 7y agoI thought you might have fun with this -- try running my example here: https://news.ycombinator.com/item?id=21842471 https://news.ycombinator.com/item?id=21842471