UnicodeEncodeError: 'ascii' codec can't encode character

前端 未结 12 810
予麋鹿
予麋鹿 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 20:55

    After investigating this some more I found out that I hadn't set the charset in my main Nginx config file:

    http {
      charset  utf-8;
    }
    

    By adding the above, the problem disappeared and I think that this is the correct way of handling this issue.

提交回复
热议问题