JSON.parse UTF-8 problem
Hi,
I have a problem when parsing a JSON-response array from a webservice I have built in PHP, returning a SQL-result from a mysql db in UTF-8.
The element I would like to get has swedish characters (å,ä,ö).
So I can't get the value like I can with the others:
Example:
var temp = json[2].Omgång;
The above doesn't work.
The compiler complains about the "å" in the example above.
I also tried to replace the "å" with the utf-8 code for the character, since the json array has the "å" encoded in utf-8 ("backslash"u00e5)
What is the most simple way to come around this?
JSON.stringify may be one way maybe, but then I need to have another array.
Someone who have a better and simple suggestion?
1 Answer
-
Accepted Answer
var temp = json[2]["Omgång"];