Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

decode strings after slurping rather than using a PerlIO layer

This avoids using an undocumented Encode.pm feature, and restores
compatibility with older versions of Encode.
  • Loading branch information...
commit 88d79dae1ae1639cc01291262fa3ccaecae7202c 1 parent 482aaec
Graham Knop haarg authored dagolden committed
Showing with 10 additions and 7 deletions.
  1. +5 −0 Changes
  2. +1 −2  cpanfile
  3. +0 −1  dist.ini
  4. +4 −4 lib/Parse/CPAN/Meta.pm
5 Changes
View
@@ -2,6 +2,11 @@ Changes for Perl programming language extension Parse-CPAN-Meta
{{$NEXT}}
+ [FIXED]
+
+ - UTF-8 decoding is done differently to avoid requiring
+ a newer version of Encode (Graham Knop)
+
1.4412 2014-02-17 07:14:43-05:00 America/New_York
[FIXED]
3  cpanfile
View
@@ -1,10 +1,9 @@
requires "CPAN::Meta::YAML" => "0.011";
requires "Carp" => "0";
-requires "Encode" => "2.11";
+requires "Encode" => "0";
requires "Exporter" => "0";
requires "File::Spec" => "0.80";
requires "JSON::PP" => "2.27200";
-requires "PerlIO::encoding" => "0";
requires "perl" => "5.008001";
requires "strict" => "0";
1  dist.ini
View
@@ -12,7 +12,6 @@ filename = t/data/BadMETA.yml
CPAN::Meta::YAML = 0.011
File::Spec = 0.80
JSON::PP = 2.27200
-Encode = 2.11
[Prereqs / TestRequires]
Test::More = 0.47
8 lib/Parse/CPAN/Meta.pm
View
@@ -71,11 +71,11 @@ sub json_backend {
sub _slurp {
require Encode;
- require PerlIO::encoding;
- local $PerlIO::encoding::fallback = Encode::PERLQQ()|Encode::STOP_AT_PARTIAL();
- open my $fh, "<:encoding(UTF-8)", "$_[0]" ## no critic
+ open my $fh, "<:raw", "$_[0]" ## no critic
or die "can't open $_[0] for reading: $!";
- return do { local $/; <$fh> };
+ my $content = do { local $/; <$fh> };
+ $content = Encode::decode('UTF-8', $content, Encode::PERLQQ());
+ return $content;
}
sub _can_load {
Please sign in to comment.
Something went wrong with that request. Please try again.