pyjade icon indicating copy to clipboard operation
pyjade copied to clipboard

Unicode, Django and PyJade: UnicodeDecodeError

Open andrewboltachev opened this issue 11 years ago • 2 comments

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?

andrewboltachev avatar Aug 13 '13 07:08 andrewboltachev

Hi @andrewboltachev I met the same question just like you did . But it does not work for me ..

aluenkinglee avatar Aug 27 '13 02:08 aluenkinglee

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?

christophercurrie avatar Sep 17 '13 19:09 christophercurrie