我在试图把外国char子从一dict子中抹掉以下错误。 你们是否有任何想法?
File "/base/data/home/apps/s~montaoproject/cap.354503891062679364/main.py", line 333, in render_jinja
self.response.out.write(template.render(data))
File "/base/data/home/apps/s~montaoproject/cap.354503891062679364/jinja2/environment.py", line 894, in render
return self.environment.handle_exception(exc_info, True)
File "/base/data/home/apps/s~montaoproject/cap.354503891062679364/templates/list_jinja.html", line 199, in top-level template code
{% for key,value in location_map_br_11_cap.items() %}<option value="3" >{{ value.name }}</option>{% endfor %}
UnicodeDecodeError: ascii codec can t decode byte 0xc3 in position 9: ordinal not in range(128)
我的变量是:
location_map_br_11_cap = {1: {
name : str( Toda Região 11 (ddd) ),
lat : -23.55,
long : -46.64,
radius : 294200,
}, 2: {
name : str( Todo Estado de São Paulo ),
lat : -22.90,
long : -43.21,
radius : 294200,
}, 1: {
name : str( Toda região Sudeste do Brasil ),
lat : -23.55,
long : -46.64,
radius : 294200,
}}
我将抱着某种希望,努力实现这一目标:
location_map_br_11_cap = {1: {
name : str( Toda Região 11 (ddd) ).decode( utf-8 ),
lat : -23.55,
long : -46.64,
radius : 294200,
}, 2: {
name : str( Todo Estado de São Paulo ).decode( utf-8 ),
lat : -22.90,
long : -43.21,
radius : 294200,
}, 1: {
name : str( Toda região Sudeste do Brasil ).decode( utf-8 ),
lat : -23.55,
long : -46.64,
radius : 294200,
}}