I know how to consume JSON string in Objective C.
For example:
{
"name":"school",
"address":"very near here"
}
This is easy because the strings are plain English.
The situation is I’d like to read JSON data that contains Unicode strings
For example:
{
"name":"trường học",
"address":"rất gần đây"
}
The strings above are Vietnamese.
or
{
"name":" 名 学校",
"address":"近义词"
}
The strings above are Chinese.
But when I display these strings in Xcode console or in UITextView, I see garbage characters.
Do you know how to read and display Unicode JSON string in iPhone projects?
As people have been suggesting before me, the underlying is most likely below the actual JSON parsing and display. Maybe your webserver is not setting the encoding correctly? Assuming the file on the server is utf8-encoded, you can force it with ASIHTTPRequest like:
If this doesn’t help, you might want to post the http headers (produce them with wget or curl) and the actual http client code.
You might also want to check out RestKit which provides a turn-key solution to http-client and json parsing.