I am stuck with utf-8 to NSString. I am getting this data from web service :
{
Description = "漢字仮名交じり文";
Images =
(
{
imageName = "0_25_07_2012_10_32_54_1343212374.jpg";
}
);
Time = "11:00 am";
actId = 290;
actTitle = "漢字仮名交じり文";
}
Now how can i convert 名 (名) this kind of code to NSString?
I’m pretty sure something is wrong with your web service. If the web service response is JSON or XML data, then the JSON or XML parser should have decoded the special characters. Since it did not, the web service mistakenly uses a double decoding of characters outside the ASCII range.
The best solution is to fix it at the source, i.e. in the web service.
If you can’t, then use the
stringByDecodingHTMLEntitiesmethod from this NSString category, e.g.:You will have to run each string property through this method.