X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fmail%2Fwrong_mime_charset.t;h=6bbaca1bbd8e8ca69c10d66e81369b3ea773794e;hb=ed1f84b4e8f626245995ecda5afcf83092c153b2;hp=511a7e61d2a8fdfc6235b384ca6235b813f3dda1;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500;p=freeside.git diff --git a/rt/t/mail/wrong_mime_charset.t b/rt/t/mail/wrong_mime_charset.t index 511a7e61d..6bbaca1bb 100644 --- a/rt/t/mail/wrong_mime_charset.t +++ b/rt/t/mail/wrong_mime_charset.t @@ -1,13 +1,10 @@ -#!/usr/bin/perl use strict; 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], @@ -41,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' ); }