[rt-users] Re: Attachments subject from message header twice encode to utf8

Alexey G Misyurenko mag at caravan.ru
Wed Oct 11 07:57:50 EDT 2006


Sorry previose patch was not correct

> p.s. I don't know is Encode::_utf8_on using is needed....

*** local/html/Ticket/Elements/ShowMessageHeaders       Wed Oct 11
15:32:37 2006
--- share/html/Ticket/Elements/ShowMessageHeaders       Tue Jun 20
02:44:04 2006
*************** $content = $m->interp->apply_escapes($co
*** 65,80 ****
   my @lines = split /\n/, $content;
   my $in_header = 0;
   my @headers;
- my $msgtag;
- my $msgval;

    for (@lines) {
        if (/^(\S+):\s+(.*)$/) {
!       $msgtag = $1;
!       $msgval = $2;
!       Encode::_utf8_on($msgval);
!       eval { $msgval = Encode::decode_utf8($msgval) };
!         push @headers, { Tag => $msgtag, Value => msgval };
       }
       elsif (/^\s+/) {
           $headers[-1]->{'Value'} .= $_;
--- 65,74 ----
   my @lines = split /\n/, $content;
   my $in_header = 0;
   my @headers;

   for (@lines) {
       if (/^(\S+):\s+(.*)$/) {
!         push @headers, { Tag => $1, Value => $2 };
       }
       elsif (/^\s+/) {
           $headers[-1]->{'Value'} .= $_;





More information about the rt-users mailing list