How to fix error Ascii codec can’t encode unicode character in Django on Ubuntu

In this article I will discuss how to fix error messages saying Ascii codec can’t encode some unicode character when setting up Django on Ubuntu.

A solution is to change the LANG and to set the LC_ALL environment variables.

So, edit /etc/apache2/envvars

Change

LANG=C

to

LANG='en_US.UTF-8'

Also add the following:

LC_ALL='en_US.UTF-8'

Leave a Reply

Your email address will not be published. Required fields are marked *