From fc6f6f37f8b700d4561f0611ef0f771349667826 Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" Date: Sat, 29 Mar 2014 15:44:03 -0500 Subject: Make perlbug encoding-agnostic in handling prepared reports. Guessing the encoding of a report file prepared ahead of time is really, well, too much guesswork, plus there are at least a couple of mistakes in the implementation. And we weren't even trying to guess for reports created on-the-fly in an editor, which is a bit inconsistent. So handle prepared reports the same way as on-the-fly reports and attachments, which means all I/O is done using the :raw layer. This is only "Unicode-aware" in the sense that we're aware there are a lot of encodings out there and we're trying not to mangle them in transit by accidental conversion. We're not doing any explicit character set conversions and we shouldn't assert in the MIME headers that we know what character set we're sending because we don't. --- utils/perlbug.PL | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'utils') diff --git a/utils/perlbug.PL b/utils/perlbug.PL index 42e8a24210..85fb134236 100644 --- a/utils/perlbug.PL +++ b/utils/perlbug.PL @@ -76,8 +76,6 @@ BEGIN { $::HaveTemp = ($@ eq ""); eval { require Module::CoreList; }; $::HaveCoreList = ($@ eq ""); - eval { require encoding; }; - $::Have_get_locale_encoding = ($@ eq "" && defined &encoding::_get_locale_encoding); }; my $Version = "1.40"; @@ -99,8 +97,6 @@ my $perl_version = $^V ? sprintf("%vd", $^V) : $]; my $config_tag2 = "$perl_version - $Config{cf_time}"; -my $input_encoding = $::Have_get_locale_encoding ? encoding::_get_locale_encoding() : ''; - Init(); if ($opt{h}) { Help(); exit; } @@ -616,7 +612,7 @@ EOF if ($body) { print REP $body; } elsif ($usefile) { - open(F, "<:$input_encoding", $file) + open(F, '<:raw', $file) or die "Unable to read report file from '$file': $!\n"; while () { print REP $_ @@ -1050,7 +1046,7 @@ sub _add_body_start { my $body_start = <<"BODY_START"; This is a multi-part message in MIME format. --$mime_boundary -Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Type: text/plain; format=fixed Content-Transfer-Encoding: 8bit BODY_START -- cgit v1.2.1