summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-10-10 13:22:42 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-10-10 13:22:42 +0100
commit87f3ebe468d1d7f84cb1a59cd87ba0009c4b1cd6 (patch)
treeaebeb1b17ed3a77ebfe4d3db1e0e3a8d7b72f2db
parentc7925a5e8559739ce765137cf6164c5872c63a96 (diff)
downloadperl-87f3ebe468d1d7f84cb1a59cd87ba0009c4b1cd6.tar.gz
Update JSON-PP to CPAN version 2.27300
[DELTA] 2.27300 - fixed a problem about substr in perl 5.8.6 and below many people report this issue and patched by haarg[at]haarg.org
-rw-r--r--MANIFEST1
-rwxr-xr-xPorting/Maintainers.pl2
-rw-r--r--cpan/JSON-PP/lib/JSON/PP.pm20
-rw-r--r--cpan/JSON-PP/t/zero-mojibake.t23
4 files changed, 33 insertions, 13 deletions
diff --git a/MANIFEST b/MANIFEST
index 8abdcfec10..ef6cf27a35 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1418,6 +1418,7 @@ cpan/JSON-PP/t/114_decode_prefix.t
cpan/JSON-PP/t/115_tie_ixhash.t
cpan/JSON-PP/t/116_incr_parse_fixed.t
cpan/JSON-PP/t/_unicode_handling.pm
+cpan/JSON-PP/t/zero-mojibake.t
cpan/libnet/Config.eg libnet
cpan/libnet/Hostname.pm.eg libnet
cpan/libnet/Makefile.PL
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index 21b6a3f825..1c5342cf7d 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -675,7 +675,7 @@ use File::Glob qw(:case);
},
'JSON::PP' => {
- 'DISTRIBUTION' => 'MAKAMAKA/JSON-PP-2.27203.tar.gz',
+ 'DISTRIBUTION' => 'MAKAMAKA/JSON-PP-2.27300.tar.gz',
'FILES' => q[cpan/JSON-PP],
},
diff --git a/cpan/JSON-PP/lib/JSON/PP.pm b/cpan/JSON-PP/lib/JSON/PP.pm
index c1b4f1b0f5..7a011a4dea 100644
--- a/cpan/JSON-PP/lib/JSON/PP.pm
+++ b/cpan/JSON-PP/lib/JSON/PP.pm
@@ -11,7 +11,7 @@ use Carp ();
use B ();
#use Devel::Peek;
-$JSON::PP::VERSION = '2.27203';
+$JSON::PP::VERSION = '2.27300';
@JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json);
@@ -655,6 +655,7 @@ BEGIN {
}
else {
utf8::upgrade( $text );
+ utf8::encode( $text );
}
$len = length $text;
@@ -806,17 +807,12 @@ BEGIN {
else{
if ( ord $ch > 127 ) {
- if ( $utf8 ) {
- unless( $ch = is_valid_utf8($ch) ) {
- $at -= 1;
- decode_error("malformed UTF-8 character in JSON string");
- }
- else {
- $at += $utf8_len - 1;
- }
+ unless( $ch = is_valid_utf8($ch) ) {
+ $at -= 1;
+ decode_error("malformed UTF-8 character in JSON string");
}
else {
- utf8::encode( $ch );
+ $at += $utf8_len - 1;
}
$is_utf8 = 1;
@@ -1630,7 +1626,7 @@ JSON::PP - JSON::XS compatible pure-Perl module.
=head1 VERSION
- 2.27202
+ 2.27300
L<JSON::XS> 2.27 (~2.30) compatible.
@@ -2791,7 +2787,7 @@ Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE
-Copyright 2007-2013 by Makamaka Hannyaharamitu
+Copyright 2007-2014 by Makamaka Hannyaharamitu
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
diff --git a/cpan/JSON-PP/t/zero-mojibake.t b/cpan/JSON-PP/t/zero-mojibake.t
new file mode 100644
index 0000000000..9a9741fe3f
--- /dev/null
+++ b/cpan/JSON-PP/t/zero-mojibake.t
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+
+use strict;
+use Test::More;
+BEGIN { plan tests => 1 };
+
+BEGIN { $ENV{PERL_JSON_BACKEND} = 0; }
+
+use JSON::PP;
+
+my $json = JSON::PP->new;
+
+my $input = q[
+{
+ "dynamic_config" : 0,
+ "x_contributors" : [
+ "大沢 和宏",
+ "Ævar Arnfjörð"
+ ]
+}
+];
+eval { $json->decode($input) };
+is $@, '', 'decodes 0 with mojibake without error';