当前位置: 首页 > 后端技术 > Python

'ascii'codeccan'tencodecharactersinposition

时间:2023-03-26 00:31:56 Python

'ascii'codeccan'tencodecharactersinposition问题runningpython3scriptinubuntuoutputtocommandlineerrorsolutionsetLANGorLC_ALLtoen_US.utf8orzh_CN.utf8lists当前设置benull@37c7dedb7a13:~#localeLANG=zh_CN.UTF-8LANGUAGE=LC_CTYPE="en_US.UTF-8"LC_NUMERIC="en_US.UTF-8"LC_TIME="en_US.UTF-8"LC_COLLATE="en_US.UTF-8"LC_COLLATE="en_US.UTF-8"LC_MONETARY="en_US.UTF-8"LC_MESSAGES="en_US.UTF-8"LC_PAPER="en_US.UTF-8"LC_NAME="en_US.UTF-8"LC_ADDRESS="en_US.UTF-8""LC_TELEPHONE="en_US.UTF-8"LC_MEASUREMENT="en_US.UTF-8"LC_IDENTIFICATION="en_US.UTF-8"LC_ALL=en_US.UTF-8列出已安装的语言环境benull@37c7dedb7a13:~#locale-aCC.UTF-8en_US.utf8POSIXzh_CN.utf8如果上面的locale不存在,使用locale-gen生成apt-getinstalllocaleslocale-gen'zh_CN.UTF-8'update-localeLC_ALL="zh_CN.UTF-8"willexportLC_ALL=zh_CN.UTF-8"addedto~/.bashrcforreferenceabout'ascii'codeccan'tencodecharactersinpositionubuntulocales设置ChineseLocale