【发布时间】:2009-04-27 16:17:16
【问题描述】:
我正在使用的视图将字符串返回到 html 模板。返回的字符串包含在模板中未正确表示的特殊字符。简单地说,从视图返回的字符串可能如下所示:
test = "\"Foo bar\""
return render_to_response('index.html', {'test': test})
并且在html模板中是这样显示的:
& quot;Foo bar& quot;
如何修复编码以使其正确显示?
【问题讨论】: