Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7728979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:51:11+00:00 2026-06-01T05:51:11+00:00

I have a lib/languages.py file only with a dict format e.g.: en = {}

  • 0

I have a lib/languages.py file only with a dict format e.g.:

en = {}
en["farewell"] = "goddbye"
es = {}
es["farewell"] = "Adiós"

Also I have a lib/basehandler.py where I use language.py and this basehandler has a Unicode literal (# –– coding: utf-8 ––)

The problem is that when I render a template in Spanish (es), the html has “Adi&ocuate;s” instead “Adi&oaucte;s”

I tried to use on languages.py

es["farewell"] = "Adiós"

or add Unicode literal (# –– coding: utf-8 ––), but nothing work.

Can anyone please, tell me what I’m doing wrong or what’s the best way to work with Unicode on Jinja2

Here is the source code https://github.com/coto/gae-boilerplate and if you want to see the problem http://appengine.protoboard.cl/?&hl=es

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:51:13+00:00Added an answer on June 1, 2026 at 5:51 am

    The library you’re using of jinja2 has autoescape default set to True. You may override this in your code by going to basehandler.py, and look for these lines:

    @webapp2.cached_property
    def jinja2(self):
        return jinja2.get_jinja2(app=self.app)
    

    Replace it with this:

    @webapp2.cached_property
    def jinja2(self):
        return jinja2.get_jinja2(app=self.app,{'environment_args':{'autoescape':False}})
    

    I’m not sure if environment_args and autoescape in the additional code above need the single quotes or not. Feel free to try different variations of them.

    If you want to keep autoescape True as the default, then you can just add |safe to each variable in your template.

    For example in home.html

    {{ lang.text_title }}
    

    becomes

    {{ lang.text_title|safe }}
    

    and so on…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have .lib file with its header (.h) file. This file have a few
We have a .lib file with functionality that must be included in a Delphi
I have a static library (.lib file) on Windows platform, I want to know
I have a binary file - Windows static library (*.lib). Is there a simple
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
I have a C++/CLI wrapper around native .lib and .h files. I use the
I use symfony 1.4.11. In my site I have 3 languages in my site
In our environment we have a Lib folder which contains various third party assemblies
I have a static library *.lib created using MSVC on windows. The size of
I have been using the lib-svm binaries for classification of my data. For training

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.