add charset to default content-type header if STDOUT is in UTF-8
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 30 May 2008 18:34:45 +0000 (18:34 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 31 May 2008 20:00:12 +0000 (20:00 +0000)
commit178a4a4de0bbc111bf376d6876af16c093e3c838
tree5abdf047240189ed35020218aa885373063ff0f8
parentb9208715f1af33e28a11156791c972d49a8363ec
add charset to default content-type header if STDOUT is in UTF-8

If output has utf8 layer enabled, it makes only sense to mark it as such
to clients.  Only available with PerlIO (as of Perl 5.8 afaict), but not
fatal (assume non-utf8) if it doesn't work.

Charset is only added at first read or change of the content-type value,
so it's not hardcoded to site defaults.  Requires an extra object
variable unfortunately, but the only way to make it useful (no page
runtime accomodation wouldn't give much advantage).
Changes
lib/PLP/Tie/Headers.pm