I am calling google translate api and getting back strings that are not fully decoded. In particular, I am seeing ' where single quotes should be.
For example:
{
"q": "det är fullt",
"target": "en"
}
Returns
{
"data": {
"translations": [
{
"translatedText": "It&\#39;s full",
"detectedSourceLanguage": "sv"
}
]
}
}
I would have expected JSON.parse to take care of this, but it does not. Is there some other native function I need to be calling? My current fix is to fix this using a regex .replace(/'/g, "'");
, but is there a better way to decode this type of thing using javascript?