Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON::Syck::Load() doesn't decode javascript escape sequences. [rt.cpan.org #25728] #21

Open
toddr opened this issue May 11, 2017 · 0 comments

Comments

@toddr
Copy link
Member

toddr commented May 11, 2017

Migrated from rt.cpan.org#25728 (status was 'new')

Requestors:

From [email protected] on 2007-03-23 22:48:59:

It seems that JSON::Syck::Load() doesn't decode javascript escape 
sequences. See my test script below that fails on my system:

use strict;
use JSON::Syck ();
use Test::More qw(no_plan);

my $json = 'line1\tline2';
my $data = JSON::Syck::Load($json);

cmp_ok($data, 'eq', "line1\tline2", 'Are simple JS escape sequences 
decoded (correctly)?');


#### The failure output ####
not ok 1 - Are JS escape sequences parsed correctly?
#   Failed test 'Are JS escape sequences parsed correctly?'
#   at ./t.pl line 9.
#          got: 'line1\tline2'
#     expected: 'line1  line2'
1..1
# Looks like you failed 1 test of 1.


Perhaps this is all intentional as is the lack of optionally converting 
perl utf8 characters into JSON \uXXXX escape sequences and 8-bit 
control characters into JSON \xXX escape sequences, and vice versa.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant