X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FTest.pm;h=104e93a63f742e1c5cd35ea41b9f2f3ac2d5ef2a;hb=ed1f84b4e8f626245995ecda5afcf83092c153b2;hp=19dc263782ee476cffdeb5759d5daf4d3f2dd565;hpb=c71b2dc296da6207c525a064d322f7153c284d4e;p=freeside.git diff --git a/rt/lib/RT/Test.pm b/rt/lib/RT/Test.pm index 19dc26378..104e93a63 100644 --- a/rt/lib/RT/Test.pm +++ b/rt/lib/RT/Test.pm @@ -164,6 +164,8 @@ sub import { $class->set_config_wrapper; + $class->encode_output; + my $screen_logger = $RT::Logger->remove( 'screen' ); require Log::Dispatch::Perl; $RT::Logger->add( Log::Dispatch::Perl->new @@ -417,6 +419,13 @@ sub set_config_wrapper { }; } +sub encode_output { + my $builder = Test::More->builder; + binmode $builder->output, ":encoding(utf8)"; + binmode $builder->failure_output, ":encoding(utf8)"; + binmode $builder->todo_output, ":encoding(utf8)"; +} + sub bootstrap_db { my $self = shift; my %args = @_; @@ -639,12 +648,7 @@ sub __init_logging { $filter = $SIG{__WARN__}; } $SIG{__WARN__} = sub { - if ($filter) { - my $status = $filter->(@_); - if ($status and $status eq 'IGNORE') { - return; # pretend the bad dream never happened - } - } + $filter->(@_) if $filter; # Avoid reporting this anonymous call frame as the source of the warning. goto &$Test_NoWarnings_Catcher; }; @@ -824,9 +828,11 @@ sub create_ticket { if ( my $content = delete $args{'Content'} ) { $args{'MIMEObj'} = MIME::Entity->build( - From => $args{'Requestor'}, - Subject => $args{'Subject'}, - Data => $content, + From => Encode::encode( "UTF-8", $args{'Requestor'} ), + Subject => RT::Interface::Email::EncodeToMIME( String => $args{'Subject'} ), + Type => "text/plain", + Charset => "UTF-8", + Data => Encode::encode( "UTF-8", $content ), ); }