[Rt-commit] r14700 - rt/3.8/trunk/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Thu Jul 31 18:14:14 EDT 2008


Author: ruz
Date: Thu Jul 31 18:14:13 2008
New Revision: 14700

Modified:
   rt/3.8/trunk/lib/RT/Attachment_Overlay.pm

Log:
* fix issue with internatinal values of header fields in ticket's history

Modified: rt/3.8/trunk/lib/RT/Attachment_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Attachment_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/Attachment_Overlay.pm	Thu Jul 31 18:14:13 2008
@@ -132,6 +132,11 @@
     #Get the filename
     my $Filename = $Attachment->head->recommended_filename;
 
+    # MIME::Head doesn't support perl strings well and can return
+    # octets which later will be double encoded in low-level code
+    my $head = $Attachment->head->as_string;
+    utf8::decode( $head );
+
     # If a message has no bodyhandle, that means that it has subparts (or appears to)
     # and we should act accordingly.  
     unless ( defined $Attachment->bodyhandle ) {
@@ -139,7 +144,7 @@
             TransactionId => $args{'TransactionId'},
             Parent        => $args{'Parent'},
             ContentType   => $Attachment->mime_type,
-            Headers       => $Attachment->head->as_string,
+            Headers       => $head,
             MessageId     => $MessageId,
             Subject       => $Subject,
         );
@@ -175,7 +180,7 @@
             ContentType     => $Attachment->mime_type,
             ContentEncoding => $ContentEncoding,
             Parent          => $args{'Parent'},
-            Headers         => $Attachment->head->as_string,
+            Headers         => $head,
             Subject         => $Subject,
             Content         => $Body,
             Filename        => $Filename,


More information about the Rt-commit mailing list