How can I use unicode strings in tornado views or templates?
I insert in template
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
And in view
# -- coding: utf-8 --
Output is ????
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Once you have your unicode string ready, the request should end
This renders the file “template.html” setting the aString variable to aUnicodeString.
template.html would look something like this:
It’s also possible to inline the HTML in the Tornado server.
More on templates here:
Tornado Web Server Documentation