Apr
24th
Sun
24th
UnicodeErrors in Django
There are times when in your Django application, displaying unicode strings can throw an except similar to:
UnicodeDecodeError at /contact/export
‘utf8’ codec can’t decode byte 0x92 in position 2: unexpected code byte
I’ve discovered that this might be due to a LOCALE setting that doesn’t support those unicode characters. To solve this problem, you have to change your LOCALE to something like UTF-8 that supports unicode characters.
From your shell, simply type:
update-locale LANG=en_US.UTF-8