X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FI18N.pm;h=448f4a28ef8d712b6f0a904c1c6765ba5117b1be;hb=5e05724a635a22776f1b973f5d7e77989da4e048;hp=affff981bdb59d46a1b6e56bc048ea01ac1adeff;hpb=d4d0590bef31071e8809ec046717444b95b3f30a;p=freeside.git diff --git a/rt/lib/RT/I18N.pm b/rt/lib/RT/I18N.pm index affff981b..448f4a28e 100644 --- a/rt/lib/RT/I18N.pm +++ b/rt/lib/RT/I18N.pm @@ -223,7 +223,7 @@ sub SetMIMEEntityToEncoding { # {{{ Convert the body eval { - $RT::Logger->debug("Converting '$charset' to '$enc' for ". $head->mime_type . " - ". $head->get('subject')); + $RT::Logger->debug("Converting '$charset' to '$enc' for ". $head->mime_type . " - ". ($head->get('subject') || 'Subjectless message')); # NOTE:: see the comments at the end of the sub. Encode::_utf8_off( $lines[$_] ) foreach ( 0 .. $#lines ); @@ -289,11 +289,13 @@ sub DecodeMIMEWordsToEncoding { my $str = shift; my $enc = shift; - - @_ = $str =~ m/([^=]*)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/g; - + @_ = $str =~ m/(.*?)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/gc; return ($str) unless (@_); + # add everything that hasn't matched to the end of the latest + # string in array this happen when we have 'key="=?encoded?="; key="plain"' + $_[-1] .= substr($str, pos $str); + $str = ""; while (@_) { my ($prefix, $charset, $encoding, $enc_str, $trailing) =