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.parse error in jsb with some string #1824

Open
kawais opened this issue Feb 22, 2016 · 0 comments
Open

Json.parse error in jsb with some string #1824

kawais opened this issue Feb 22, 2016 · 0 comments

Comments

@kawais
Copy link

kawais commented Feb 22, 2016

var x="%7B%22str%22%3A%22%7B%5C%22iv%5C%22%3A%5C%22wt5AsR8BtNteecathMxjnQ%3D%3D%5C%22%2C%5C%22v%5C%22%3A1%2C%5C%22iter%5C%22%3A1000%2C%5C%22ks%5C%22%3A256%2C%5C%22ts%5C%22%3A64%2C%5C%22mode%5C%22%3A%5C%22ccm%5C%22%2C%5C%22adata%5C%22%3A%5C%22%5C%22%2C%5C%22cipher%5C%22%3A%5C%22aes%5C%22%2C%5C%22salt%5C%22%3A%5C%224d5i3s4avb6e0zfrA%3D%3D%3D%5C%22%2C%5C%22ct%5C%22%3A%5C%22kJwDrBcuHA9MQkZneuGac2g%2Bpg%3D%3D%5C%22%7D%22%2C%22crc%22%3A%5B1456649782307%2C1457243361344%2C1456172239357%2C1455699551544%2C1454868939948%2C1457629410864%2C1454195993821%2C1456905607301%5D%2C%22t%22%3A1456158840960%7D";
var y=decodeURIComponent(x);
//y="{"str":"{"iv":"wt5AsR8BtNteecathMxjnQ==","v":1,"iter":1000,"ks":256,"ts":64,"mode":"ccm","adata":"","cipher":"aes","salt":"4d5i3s4avb6e0zfrA===","ct":"kJwDrBcuHA9MQkZneuGac2g+pg=="}","crc":[1456649782307,1457243361344,1456172239357,1455699551544,1454868939948,1457629410864,1454195993821,1456905607301],"t":1456158840960}";
var z=JSON.parse(y);
//error in jsb: SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 4 of the JSON data

these code can work fine in web browser, but error in jsb at line with JSON.parse.

how to solve it?

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