Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions t/001_utf8.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use utf8;
use JSON::PP;

my $pilcrow_utf8 = (ord "^" == 0x5E) ? "\xc2\xb6" # 8859-1
: (ord "^" == 0x5F) ? "\x80\x65" # CP 1024
: (ord "^" == 0x5F) ? "\x80\x65" # CP 1047
: "\x78\x64"; # assume CP 037
is (JSON::PP->new->allow_nonref (1)->utf8 (1)->encode ("¶"), "\"$pilcrow_utf8\"");
is (JSON::PP->new->allow_nonref (1)->encode ("¶"), "\"¶\"");
Expand All @@ -26,7 +26,6 @@ is (JSON::PP->new->allow_nonref (1)->decode ('"\u00b6"'), "¶");
is (JSON::PP->new->allow_nonref (1)->decode ('"\ud801\udc02' . "\x{10204}\""), "\x{10402}\x{10204}");

my $controls = (ord "^" == 0x5E) ? "\012\\\015\011\014\010"
: (ord "^" == 0x5F) ? "\025\\\015\005\014\026" # CP 1024
: (ord "^" == 0x5F) ? "\025\\\015\005\014\026" # CP 1047
: "\045\\\015\005\014\026"; # assume CP 037
is (JSON::PP->new->allow_nonref (1)->decode ('"\"\n\\\\\r\t\f\b"'), "\"$controls");

9 changes: 8 additions & 1 deletion t/119_incr_parse_utf8.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use strict;
use warnings;
use Test::More tests => 24;
use Test::More;

use utf8;
use JSON::PP;
Expand All @@ -9,6 +9,13 @@ use charnames qw< :full >;

use vars qw< @vs >;

if (ord "A" == 65) {
plan tests => 24;
}
else {
plan skip_all => "Hard-coded ASCII UTF-8 doesn't play well on EBCDIC";
}

############################################################
### These first tests mimic the ones in `t/001_utf8.t` ###
############################################################
Expand Down
Loading