1 # copied over from JSON::PP::XS and modified to use JSON::PP
5 BEGIN { plan tests => 4 };
7 BEGIN { $ENV{PERL_JSON_BACKEND} = 0; }
11 use _unicode_handling;
17 skip "UNICODE handling is disabale.", 4 unless $JSON::PP::can_handle_UTF16_and_utf8;
19 my $xs = JSON::PP->new->latin1->allow_nonref;
21 ok $xs->encode ("\x{12}\x{89} ") eq "\"\\u0012\x{89} \"";
22 ok $xs->encode ("\x{12}\x{89}\x{abc}") eq "\"\\u0012\x{89}\\u0abc\"";
24 ok $xs->decode ("\"\\u0012\x{89}\"" ) eq "\x{12}\x{89}";
25 ok $xs->decode ("\"\\u0012\x{89}\\u0abc\"") eq "\x{12}\x{89}\x{abc}";