Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError when insert UTF-8 text into value-attr #10

Closed
kzfm opened this issue Apr 1, 2012 · 4 comments
Closed

UnicodeEncodeError when insert UTF-8 text into value-attr #10

kzfm opened this issue Apr 1, 2012 · 4 comments

Comments

@kzfm
Copy link

kzfm commented Apr 1, 2012

Hello,

In pyjade1.0, this doesn't work and got UnicodeEncodeError.

input(type="text", name="title",  value="some_utf-8_txt")

but this works fine

input(type="text", name="title", value="ascii_txt")
@syrusakbary
Copy link
Owner

This bug is now fixed in 1.0.1 version

Thanks ;)

@syrusakbary syrusakbary reopened this Apr 1, 2012
@syrusakbary
Copy link
Owner

I'm sorry,
This is only fixed in Jinja2. Using Django or Mako raises an Exception.

Working on that...

@syrusakbary
Copy link
Owner

This is now fixed in Django, Mako still raising an Exception

@syrusakbary
Copy link
Owner

The utf8 default encoding for Mako is solved with:

t = Template(templatetext, default_filters=['decode.utf8'])

Note the default_filters=['decode.utf8']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants