Commit b2e341b3 authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Move "use Encode" calls to one central location

parent 4d70cfb3
......@@ -53,6 +53,7 @@ use 5.010;
package RT;
use Encode ();
use File::Spec ();
use Cwd ();
use Scalar::Util qw(blessed);
......
......@@ -62,7 +62,6 @@ use Locale::Maketext 1.04;
use Locale::Maketext::Lexicon 0.25;
use base 'Locale::Maketext::Fuzzy';
use Encode;
use MIME::Entity;
use MIME::Head;
use File::Glob;
......
......@@ -68,7 +68,6 @@ use URI qw();
use RT::Interface::Web::Menu;
use RT::Interface::Web::Session;
use Digest::MD5 ();
use Encode qw();
use List::MoreUtils qw();
use JSON qw();
use Plack::Util;
......
......@@ -253,7 +253,6 @@ use Plack::Builder;
use Plack::Request;
use Plack::Response;
use Plack::Util;
use Encode;
sub PSGIApp {
my $self = shift;
......
......@@ -75,7 +75,6 @@ require RT::User;
require RT::Attributes;
require RT::Transactions;
require RT::Link;
use Encode qw();
our $_TABLE_ATTR = { };
......
......@@ -672,7 +672,6 @@ sub _DowngradeFromHTML {
$orig_entity->head->mime_attr( "Content-Type" => 'text/html' );
$orig_entity->head->mime_attr( "Content-Type.charset" => 'utf-8' );
require Encode;
my $body = $new_entity->bodyhandle->as_string;
$body = Encode::decode( "UTF-8", $body );
my $html = RT::Interface::Email::ConvertHTMLToText( $body );
......
......@@ -83,7 +83,6 @@ use Crypt::Eksblowfish::Bcrypt qw();
use RT::Principals;
use RT::ACE;
use RT::Interface::Email;
use Encode;
use Text::Password::Pronounceable;
sub _OverlayAccessible {
......
......@@ -48,7 +48,6 @@
<%init>
use Data::ICal;
use Data::ICal::Entry::Event;
use Encode ();
my $path = $m->dhandler_arg;
......
......@@ -46,8 +46,6 @@
%#
%# END BPS TAGGED BLOCK }}}
<%INIT>
use Encode ();
my $old_current_user;
if ( $m->request_comp->path =~ RT->Config->Get('WebNoAuthRegex') ) {
......
......@@ -20,7 +20,6 @@ use HTML::Mason;
use HTML::Mason::Compiler;
use HTML::Mason::Compiler::ToObject;
BEGIN { require RT::Test; }
use Encode;
sub compile_file {
my $file = shift;
......
......@@ -58,7 +58,6 @@ is ($#headers, 2, "testing a bunch of singline multiple headers" );
my $mime = $attachment->ContentAsMIME;
like( $mime->head->get('Content-Type'),
qr/charset="iso-8859-1"/, 'content type of ContentAsMIME is original' );
require Encode;
is(
Encode::decode( 'iso-8859-1', $mime->stringify_body ),
Encode::decode( 'UTF-8', "Håvard\n" ),
......
......@@ -3,7 +3,6 @@ use strict;
use RT::Test nodata => 1, tests => 11;
use RT::I18N;
use Encode;
my %map = (
'euc-cn' => 'gbk',
......
......@@ -4,8 +4,6 @@ use warnings;
use RT::Test tests => 16;
use Encode qw(encode);
use constant HAS_ENCODE_GUESS => Encode::Guess->require;
use constant HAS_ENCODE_DETECT => Encode::Detect::Detector->require;
......
......@@ -3,7 +3,6 @@ use strict;
use RT::Test nodata => 1, tests => undef;
use RT::I18N;
use Encode;
use Test::Warn;
diag "normal mime encoding conversion: utf8 => iso-8859-1";
......
......@@ -3,7 +3,6 @@ use warnings;
use RT::Test;
use Digest::MD5;
use Encode;
my $default = "bcrypt";
......
use strict;
use warnings;
use Encode;
use RT::Test tests => 79, text_templates => 1;
......
use strict;
use warnings;
use Encode;
use RT::Test tests => 78;
......
......@@ -3,7 +3,6 @@ use warnings;
use RT::Test tests => 12;
use Test::Warn;
use Encode;
my ($baseurl, $m) = RT::Test->started_ok;
......
......@@ -3,9 +3,8 @@ use warnings;
use RT::Test nodb => 1, tests => undef;
use_ok('RT::I18N');
use Encode;
my $test_string = Encode::decode("UTF-8", 'À');
my $encoded_string = encode( 'iso-8859-1', $test_string );
my $encoded_string = Encode::encode( 'iso-8859-1', $test_string );
my $mime = MIME::Entity->build(
"Subject" => $encoded_string,
"Data" => [$encoded_string],
......@@ -35,10 +34,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' );
......
......@@ -3,7 +3,6 @@ use strict;
use warnings;
use RT::Test tests => 32;
use Encode;
my ( $baseurl, $m ) = RT::Test->started_ok;
ok $m->login, 'logged in as root';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment