[Rt-commit] r19552 - rt/3.8/trunk/share/html/Ticket/Attachment/WithHeaders
elacour at bestpractical.com
elacour at bestpractical.com
Thu May 7 03:33:31 EDT 2009
Author: elacour
Date: Thu May 7 03:33:31 2009
New Revision: 19552
Modified:
rt/3.8/trunk/share/html/Ticket/Attachment/WithHeaders/dhandler
Log:
When downloading message with headers, try to add charset information to
content_type so the raw message is displayed correctly in browser.
Modified: rt/3.8/trunk/share/html/Ticket/Attachment/WithHeaders/dhandler
==============================================================================
--- rt/3.8/trunk/share/html/Ticket/Attachment/WithHeaders/dhandler (original)
+++ rt/3.8/trunk/share/html/Ticket/Attachment/WithHeaders/dhandler Thu May 7 03:33:31 2009
@@ -59,8 +59,16 @@
Abort("Couldn't load attachment #$id");
}
+ my $content_type = 'text/plain';
+ if ( my $enc = $AttachmentObj->OriginalEncoding ) {
+ # normalize Encode.pm convention with IANA ones
+ $enc = 'big5' if $enc eq 'big5-eten';
+ $enc = 'utf-8' if $enc eq 'utf8';
+ $content_type .= ";charset=$enc";
+ }
+
# XXX: should we check handle html here and integrate headers into html?
- $r->content_type( 'text/plain' );
+ $r->content_type( $content_type );
$m->clear_buffer;
$m->out( $AttachmentObj->Headers );
$m->out( "\n\n" );
More information about the Rt-commit
mailing list