Reputation: 21
JSON String:
{
"id":31896,
"name":"Zickey attitude - McKinley,
La Rosi\u00e8re,
21 ao\u00fbt 2006",
...
}
this causes an unterminated string in JavaScript.
My attempt at a solution is:
data.replace(/(\S)\1(\1)+/g, '');
or
data.replace(/\\u([0-9A-Z])/, '');
any ideas/solution?
last node is the problem, fyi.
(/\\u([0-9A-Z])/, '\1');
Upvotes: 1
Views: 652
Reputation: 21
well, the error occures only when using jsonpretty :).
shame on me ;)
Upvotes: 1
Reputation: 25946
Your problem is not the unicode escapes, but the unescaped newlines.
{
"id":31896,
"name":"Zickey attitude - McKinley,\nLa Rosi\u00e8re,\n21 ao\u00fbt 2006"
}
Upvotes: 1