One Hat Cyber Team
Your IP :
216.73.217.146
Server IP :
50.6.229.107
Server :
Linux server.hostburly.com 5.14.0-611.38.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:21:28 EDT 2026 x86_64
Server Software :
Apache
PHP Version :
8.2.30
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
.cpan
/
build
/
JSON-4.10-0
/
t
/
Edit File:
01_utf8.t
# copied over from JSON::XS and modified to use JSON use strict; use warnings; use Test::More; BEGIN { plan tests => 9 }; BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } use utf8; use JSON; my $pilcrow_utf8 = (ord "^" == 0x5E) ? "\xc2\xb6" # 8859-1 : (ord "^" == 0x5F) ? "\x80\x65" # CP 1024 : "\x78\x64"; # assume CP 037 is (JSON->new->allow_nonref (1)->utf8 (1)->encode ("¶"), "\"$pilcrow_utf8\""); is (JSON->new->allow_nonref (1)->encode ("¶"), "\"¶\""); is (JSON->new->allow_nonref (1)->ascii (1)->utf8 (1)->encode (chr 0x8000), '"\u8000"'); is (JSON->new->allow_nonref (1)->ascii (1)->utf8 (1)->pretty (1)->encode (chr 0x10402), "\"\\ud801\\udc02\"\n"); eval { JSON->new->allow_nonref (1)->utf8 (1)->decode ('"¶"') }; ok $@ =~ /malformed UTF-8/; is (JSON->new->allow_nonref (1)->decode ('"¶"'), "¶"); is (JSON->new->allow_nonref (1)->decode ('"\u00b6"'), "¶"); is (JSON->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 : "\045\\\015\005\014\026"; # assume CP 037 is (JSON->new->allow_nonref (1)->decode ('"\"\n\\\\\r\t\f\b"'), "\"$controls");
Simpan