summaryrefslogtreecommitdiff
path: root/rt/t/mail/wrong_mime_charset.t
diff options
context:
space:
mode:
Diffstat (limited to 'rt/t/mail/wrong_mime_charset.t')
-rw-r--r--rt/t/mail/wrong_mime_charset.t10
1 files changed, 4 insertions, 6 deletions
diff --git a/rt/t/mail/wrong_mime_charset.t b/rt/t/mail/wrong_mime_charset.t
index 530b5f38d..6bbaca1bb 100644
--- a/rt/t/mail/wrong_mime_charset.t
+++ b/rt/t/mail/wrong_mime_charset.t
@@ -3,10 +3,8 @@ use warnings;
use RT::Test nodb => 1, tests => 6;
use_ok('RT::I18N');
-use utf8;
-use Encode;
-my $test_string = 'À';
-my $encoded_string = encode( 'iso-8859-1', $test_string );
+my $test_string = Encode::decode("UTF-8", 'À');
+my $encoded_string = Encode::encode( 'iso-8859-1', $test_string );
my $mime = MIME::Entity->build(
"Subject" => $encoded_string,
"Data" => [$encoded_string],
@@ -40,10 +38,10 @@ like(
"We can't encode something into the wrong encoding without Encode complaining"
);
-my $subject = decode( 'iso-8859-1', $mime->head->get('Subject') );
+my $subject = Encode::decode( 'iso-8859-1', $mime->head->get('Subject') );
chomp $subject;
is( $subject, $test_string, 'subject is set to iso-8859-1' );
-my $body = decode( 'iso-8859-1', $mime->stringify_body );
+my $body = Encode::decode( 'iso-8859-1', $mime->stringify_body );
chomp $body;
is( $body, $test_string, 'body is set to iso-8859-1' );
}