Mod_python and encoding problem

J

Johny

I use a mod_python request handler and need the output( HTML pages)
to be in utf-8 encoding)

So, I added to my handler
req.content_type = 'text/html ;charset=utf-8'
req.write(''' <html>
.....
....
(</html>""".decode('utf8').encode('utf8'))

The problem now is that when I try to call the handler , it is not run
properly but instead a download dialog is open I am asked where I
want to download that handler.

If I ,however,remove
charset=utf-8
from
req.content_type = 'text/html ;charset=utf-8'
handler works well but the utf-8 coding is not set properly
Can anyone help/explain?
Thanks
LL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top