diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-09-15 20:44:48 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-09-15 20:44:48 -0700 |
commit | ed1f84b4e8f626245995ecda5afcf83092c153b2 (patch) | |
tree | 3f58bbef5fbf2502e65d29b37b5dbe537519e89d /rt/lib/RT/Test.pm | |
parent | fe9ea9183e8a16616d6d04a7b5c7498d28e78248 (diff) |
RT 4.0.22
Diffstat (limited to 'rt/lib/RT/Test.pm')
-rw-r--r-- | rt/lib/RT/Test.pm | 24 |
1 files changed, 15 insertions, 9 deletions
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 ), ); } |