UnicodeEncodeError: 'ascii' codec can't encode character in position 0: ordinal not in range(128)

前端 未结 4 1879
一整个雨季
一整个雨季 2020-12-04 18:00

I\'m working on a Python script that uses the scissor character (9986 - ✂) and I\'m trying to port my code to Mac, but I\'m running into this error.

The scissor char

4条回答
  •  既然无缘
    2020-12-04 18:54

    My locale is set to de_AT.UTF-8 but these lines in /etc/profile were missing:

    export LANG=de_AT.UTF-8
    export LANGUAGE=de_AT.UTF-8
    export LC_ALL=de_AT.UTF-8
    

    logout / login and your problem should be solved

    To verify if all locales are set correctly type locale in your terminal

    The output should be similar to this:

    LANG=de_AT.UTF-8
    LANGUAGE=de_AT.UTF-8
    LC_CTYPE="de_AT.UTF-8"
    LC_NUMERIC="de_AT.UTF-8"
    LC_TIME="de_AT.UTF-8"
    LC_COLLATE="de_AT.UTF-8"
    LC_MONETARY="de_AT.UTF-8"
    LC_MESSAGES="de_AT.UTF-8"
    LC_PAPER="de_AT.UTF-8"
    LC_NAME="de_AT.UTF-8"
    LC_ADDRESS="de_AT.UTF-8"
    LC_TELEPHONE="de_AT.UTF-8"
    LC_MEASUREMENT="de_AT.UTF-8"
    LC_IDENTIFICATION="de_AT.UTF-8"
    LC_ALL=de_AT.UTF-8
    

提交回复
热议问题