Understanding Python Unicode and Linux terminal

后端 未结 2 883
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 21:46

I have a Python script that writes some strings with UTF-8 encoding. In my script I am using mainly the str() function to cast to string. It looks like that:

2条回答
  •  醉梦人生
    2020-12-09 22:31

    If it outputs to the terminal then Python can examine the value of $LANG to pick a charset. All bets are off if you redirect.

提交回复
热议问题