[rt-users] HA: UTF8, MIME::Encoding Subject Line, troubles again/still.

Alexey G Misyurenko mag at caravan.ru
Mon Jan 28 04:57:48 EST 2008


Hi!

Ruslan ss you asked for
RT now is 3.6.6 but bug still present.

**
First situation when it is seen is modification of subject by template.

If subject is not modified by template all is ok

Subject: =?UTF-8?B?W2NhcmF2YW4gIzIwMDQ2NDZdINCi0JXQodCi?=

If subject is modified by template by next one line on template

Subject: AutoReplay: {$Ticket->Subject()}

The final Subject line is broken

Subject: =?UTF-8?B?W2NhcmF2YW4gIzIwMDQ2NzldIEF1dG9SZXBsYXk6IMOQwqLDkMKVw5DCocOQ?=
 =?UTF-8?B?wqI=?=

In this to tests I use single Russian word ТЕСТ (4 chars. Word id equivalent to English word test).

** 
Next bug is in showing transactions.
For test is, I reply to the first ticked created upper.
It's subject line is

Subject: =?UTF-8?B?W2NhcmF2YW4gIzIwMDQ2NDZdINCi0JXQodCi?=


Without next changes Subject displayed on transaction history, showed broken.

*** share/html/Ticket/Elements/ShowMessageHeaders       2007-04-24 21:21:42.000000000 +0400
--- local/html/Ticket/Elements/ShowMessageHeaders       2008-01-25 17:46:27.000000000 +0300
*************** $content = $m->interp->apply_escapes($co
*** 67,76 ****
  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'} .= $_;
--- 67,84 ----
  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) };
!         if ( !length($msgval) ) { Encode::_utf8_off($msgval); $msgval = $2; };
! 
!         push (@headers, { Tag => $msgtag, Value => $msgval} ); 
      }
      elsif (/^\s+/) {
          $headers[-1]->{'Value'} .= $_;


If it's needed I can send information stored if datebase..


-----Исходное сообщение-----
От: ruslan.zakirov at gmail.com [mailto:ruslan.zakirov at gmail.com] От имени Ruslan Zakirov
Отправлено: 26 января 2008 г. 12:13
Кому: Alexey G Misyurenko
Копия: rt-users at lists.bestpractical.com
Тема: Re: [rt-users] UTF8, MIME::Encoding Subject Line, troubles again/still.

First of all try 3.6.6. Does it depend on a way message comes into the
system? Describe how to reproduce it. or even better send a MIME
message as attachment so we can reproduce it ourself.

2008/1/24 Alexey G Misyurenko <mag at caravan.ru>:
> Hi!
>
> Looks like this probles take plase if value of $value variable is mixed,
> i.e. exist single byte coded chars and double byte coded chars on it.
>

-- 
Best regards, Ruslan.




More information about the rt-users mailing list