开发者

Non english character in NSString

In my application server give response text in non English characters. I parse this data and store this in string.

I want string operation on this string but due to non English characters, I got error and crash.

Specially this happen when hindi characters available in response.

Please help me.

开发者_C百科

Thanks in advance.


The problem could be with the way your are getting the data from the server and storing it in the NSString. You might be decoding your data with ASCII characterset.

Try with this NSUTF8StringEncoding. This could solve your problem:

NSString *string =  [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜