RaR
RaR

Reputation: 233

No encoding declared

I keep getting this error:

 SyntaxError: Non-ASCII character '\xe4' in file /var/www/mooimom_django/mooimom_tw/models.py on line 716, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

because of:

subdistrict_destination_text    = models.CharField(verbose_name=pgettext_lazy('taiwan-models Shopping_Cart', "Subdistrict Destination Text"), max_length=255, default='100 中正區')

How to solve this problem? thanks

Upvotes: 12

Views: 11591

Answers (1)

Mani Shirvani
Mani Shirvani

Reputation: 328

add this to top of your file:

# -*- coding: utf-8 -*-

Upvotes: 12

Related Questions