Problem with UTF-8 in subject

Hi everyone

After upgrading perl (5.20 -> 5.24) on my FreeBSD box (11.0-Release-p10) I’ve got a problem with UTF-8 character in the subject

If I create a ticket using a email (everything work throught the webgui) with a UTF-8 characters in the subject the ticket is created correctly but the mail send by RT cut the subject at the first
no-ASCII characters.

With the body of the message the UTF-8 characters are transform to some weird characters. Something goes wrong with any UTF-8 characters…

Anyone got this issue ?

Regards

So I spend a lot of time trying to find where the problem is.

I put lot of debugging message and I send a mail to RT with this subject

Essai de é à et Cie

the message received by RT seem to have this subject

Essai de =?iso-8859-1?B?6SDg?= et Cie

who, according to ruby, are correct :

Mail::Encodings.unquote_and_convert_to(‘Essai de =?iso-8859-1?B?6SDg?= et Cie’,‘utf-8’)
=> “Essai de é à et Cie”

Inside the log of RT we can see RT calling the function

_DecodeMIMEWordsToEncoding (inside I18n.pm file)

with
'Essai de =?iso-8859-1?B?6SDg?= et Cie ’
and
‘utf-8’
as arguments

The function _DecodeMIMEWordsToEncoding seem to use this block (line 451-452 in I18n.pm)

        use MIME::Base64;
        $enc_str = decode_base64($enc_str);

from that I think everything goes wrong, because the string “6SDg” is convert to

'é à ’
(who are not correct I think) and re-encode by the block (line 460-461 in I18n.pm)

460             if ( Encode::find_encoding($charset) ) {
461                 Encode::from_to( $enc_str, $charset, $to_charset );

to

'ÃM-^C© ÃM-^C ’

from that nothing work correctly.

Regards.

In fact I was wrong the problem don’t comme from
use MIME::Base64;
$enc_str = decode_base64($enc_str);
the result are correct, it’s RT::Logger who re-encode the message.

So the true is out there, but I didn’t find where, I try to track where the subject is cut, and didn’t find it.

All I can say is the subject are correct inside the mysqld database, but somewhere between the mysql database and the email
the subject is cut. The webgui show the correct subject.

It seem inside the Attachment.pm at the beginning of Create function

# If we possibly can, collapse it to a singlepart
$Attachment->make_singlepart;

my $head = $Attachment->head;

the

$head->get('subject');

is already cut.

Any help ?

Regards.

Hi Albert,

Which version of the DBD::mysql Perl module do you have installed? If you have 4.042 you’ll need to manually downgrade to 4.041 due to changes in how it handles Unicode encoding.

Best,
Shawn

Le 21/06/2017 à 18:30:27+0000, Shawn Moore a écrit

shawn
June 21

Hi,

Which version of the DBD::mysql Perl module do you have installed? If you have
4.042 you’ll need to manually downgrade to 4.041 due to changes in how it
handles Unicode encoding.

You’re absolutly right, by downgrade to 4.041 everything work again.

I spend 3 days to try to find where the problem are, so thanks you a LOT.

Regards.