4 use RT::Test nodata => 1, tests => 3;
10 my $encoded_string = encode( 'iso-8859-1', $test_string );
11 my $mime = MIME::Entity->build(
12 "Subject" => $encoded_string,
13 "Data" => [$encoded_string],
16 # set the wrong charset mime in purpose
17 $mime->head->mime_attr( "Content-Type.charset" => 'utf8' );
19 RT::I18N::SetMIMEEntityToEncoding( $mime, 'iso-8859-1' );
23 'need a better approach of encoding converter, should be fixed in 4.2';
25 my $subject = decode( 'iso-8859-1', $mime->head->get('Subject') );
27 is( $subject, $test_string, 'subject is set to iso-8859-1' );
28 my $body = decode( 'iso-8859-1', $mime->stringify_body );
30 is( $body, $test_string, 'body is set to iso-8859-1' );