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' );
20 my $subject = decode( 'iso-8859-1', $mime->head->get('Subject') );
22 is( $subject, $test_string, 'subject is set to iso-8859-1' );
23 my $body = decode( 'iso-8859-1', $mime->stringify_body );
25 is( $body, $test_string, 'body is set to iso-8859-1' );