UnicodeEncodeError: 'ascii' codec can't encode character

前端 未结 12 817
予麋鹿
予麋鹿 2020-11-30 20:31

When uploading files with non-ASCII characters I get UnicodeEncodeError:

Exception Type: UnicodeEncodeError at /admin/studio/newsitem/add/
Exception Value: \         


        
12条回答
  •  孤城傲影
    2020-11-30 21:01

    akaihola's answer was helpful. For those who run django app with uWSGI managed via upstart script, just add these lines to your /etc/init/yourapp.conf

    env LANG="en_US.utf8"
    env LC_ALL="en_US.UTF-8"
    env LC_LANG="en_US.UTF-8"
    

    It solved the problem for me.

提交回复
热议问题