So I have a valid JSON string with Japanese characters but whenever I try and parse it I gets caught up on a specific character that it says is invalid.
Here's the offending string that's causing it. If you copy and past this and try to parse it, you get an error. You can also use JSONLint which will format it so it's easier to see
str = '{ "uuid": "214959c1-8f13-43e1-89a3-8ee1c891a118", "token": "de45f7ca-00de-4c33-892e-ebcb0424ac2a", "account": { "type": "account", "acoounts_id" : "123456", "email" : "shinoda@timedia.co.jp", "account_status_id" : "11", "is_active" : true, "region" : "JP", "profiles": [ { "type": "profile", "profile_id": "4567", "account_id": "123", "first_name": "有里", "last_name": "篠田", "gender": "female", "is_kids": false, "language": "en", "has_pincode": true, "favorite_genres_selected": true, "images": { "profile_icon": { "src": "http://icon.mypics.com/profile_4567.jpg" } } }, { "type": "profile", "profile_id": "1234", "account_id": "345", "first_name": "高顕", "last_name": "中野", "gender": "male", "is_kids": true, "language": "ja", "has_pincode": false, "favorite_genres_selected": true, "images": { "profile_icon": { "src": "http://icon.mypics.com/profile_4567.jpg" } } } ] }}';
var parsed = JSON.parse(str);
And getting the error
Uncaught SyntaxError: Unexpected token (…)
Does anyone have any possible explanations? Any workarounds? The main issue is that I'm trying to return this as a response and without being able to convert it to an object the response type is all wonky.
I'm using a Node.js server running Express if that helps with providing any workarounds.