[mod_python] How to change charset on the Content-Type line throu mod_python.publisher

Martin MOKREJŠ mmokrejs at ribosome.natur.cuni.cz
Fri May 12 15:06:21 EDT 2006


Hi,
  I am trying to figure out how to affect my charset other than use
AddCharset Apache directive, which works over file extensions.
I don't think it makes sense to assign say 'utf8' to .html file extension.
When the HTML code is generated through mod_python.publisher, I should
be able to do it.
  The only examples how to alter Content-Type: is to use your own
handler. No, I don't need it, thanks. I'd immediately fall into the trap
with need to use 'req.write', 'return apache.OK', etc. somewhere in my
code.


http://www.modpython.org/live/current/doc-html/pyapi-mprequest-mem.html

<QUOTE>
content_languages
    Tuple. List of strings representing the content languages. 

handler
    The name of the handler currently being processed. This is the handler
    set by mod_mime, not the mod_python handler. In most cases it will be
    ""mod_python". (Read-Only) 

content_encoding
    String. Content encoding. (Read-Only) 
</QUOTE>


  I awfully lack examples in the documentation. So, how can I make publisher
change my charset away from the site-wide defined value? Please update the
docs. I very much appreciate the effort Graham and Nicolas does to support
this email list but save yourself some time and fix the docs for yourself! ;)
Martin


More information about the Mod_python mailing list