Eh, I've figured it out.
The message I sent to the template is not a string "XXX" but a list
["XXX"].
That's why I see "\x??\x??" on the rendered page
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
On Sun, 2006-08-13 at 17:10 +, 一首诗 wrote:
> Actually, it's not the problem of encoding, I think.
Then you need to provide a more concrete example. Show a small example
of the input string (UTF-8 encoded) and the HTTP headers and bytes you
get in the response so that we can help you diagnose i
Actually, it's not the problem of encoding, I think.
For example, if s is a string, the render() method should treate {{ s
}} in the way print() does. But now what I see on the page is
something like you see in a interactive python console.
>>> print s
XXX #Some text
>>> s
'\x0f\xde' #thi
On Sun, 2006-08-13 at 12:33 +, 一首诗 wrote:
> When use something like this in a template
>
> {{ message }} X
>
> and render it in this way:
>
> c = Context({'message':s}) # s is an string encoded in utf-8
> Response(template.render(c))
>
> What I got is:
>
> '\x??\x??..\x??\x?
When use something like this in a template
{{ message }} X
and render it in this way:
c = Context({'message':s}) # s is an string encoded in utf-8
Response(template.render(c))
What I got is:
'\x??\x??..\x??\x??'
What's the problem??
--~--~-~--~~~-
5 matches
Mail list logo