You're just encoding the filename in utf-8 (which is identical to its
ASCII encoding as it doesn't comain non-ASCII characters) and then
passing that encoded filename to django's template engine.)

On Dec 16, 5:11 pm, fatimah mujallid <[email protected]> wrote:
> Ok this code works great:
> self.response.out.write(u'
> السلام عليكم'.encode('utf-8'))
> but when i use an html page instead of a string just like this:
> self.response.out.write(template.render(u'test.html'.encode('utf-8')))
> it displays arabic characters rabish
> in the html page i tried to write this:
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> and tried with out it
> both displays arabic characters rabish
>
> 2010/12/17 fatimah mujallid <[email protected]>
>
>
>
>
>
>
>
> > Ok this code works great:
> > self.response.out.write(u'السلام عليكم'.encode('utf-8'))
> > but when i use an html page instead of a string just like this:
> > self.response.out.write(template.render(u'test.html'.encode('utf-8')))
> > it displays arabic characters rabish
> > in the html page i tried to write this:
> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> > and tried with out it arabic characters rabish
> > both displays
> > 2010/12/16 风笑雪 <[email protected]>
>
> > I suggest you always use UTF-8, not windows-1256.
>
> >> However, if you insist on using windows-1256, you should encode your
> >> unicode output to str:
> >> self.response.out.write(u'some unicode string'.*encode*('windows-1256'))
> >> or:
> >> self.response.out.write('some windows-1256 string') # don't decode it
>
> >> ----------
> >> keakon
>
> >> My blog(Chinese):www.keakon.net
> >> Blog source code:https://bitbucket.org/keakon/doodle/
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Google App Engine" group.
> >> To post to this group, send email to [email protected].
> >> To unsubscribe from this group, send email to
> >> [email protected]<google-appengine%2Bunsubscrib
> >>  [email protected]>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/google-appengine?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to