[Twisted-web] how to set charset of html page

Benjamin Ferrari a9bejo at yahoo.de
Wed Sep 1 13:18:25 MDT 2004


I just started with twisted, so I guess this is a very easy question:

I run a twisted.web server with mktap:

% mktap web --path /path/to/content
% twistd -nf web.tap

and then put a simple html page into the path folder:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
<html xmlns="http://www.w3.org/1999/xhtml">
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

unfortunately, browsers (tested with firefox 0.9.3 and IE6) completly 
ignore the <meta/> tag and detect the page as UTF-8 instead of iso-8859-1.

with apache, I can set a default charset to use with

AddDefaultCharset iso-8859-1

How can I do that with the twisted server ?

Thanks for your help,


PS: I'm running twisted as a reverse proxy behind an apache2 server. Not 
sure if that matters.

More information about the Twisted-web mailing list