pyjade
pyjade copied to clipboard
Unicode, Django and PyJade: UnicodeDecodeError
I noticed that if I use Unicode in my *.jade templates, at least in some complex way, like parameter for mixin, it produces famous UnicodeDecodeError (my Python version is 2.7).
The problem is that string with unicode characters goes to eval()
, but string has form 'äää'
, either than u'äää'
. u
prefix is not part of template syntax (and shouldn't be).
I solved that problem by adding two lines into beginning of ext/django/templatetags.py
file:
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
The question: isn't that modification (i.e. making all strings Unicode) make performance worse?
Hi @andrewboltachev I met the same question just like you did . But it does not work for me ..
There is at least one unicode related bug that is fixed in master (8a146771) but hasn't been released. Is there any plan for a patch release anytime soon?