UTF8 character decoding in Objective C

后端 未结 4 2048
[愿得一人]
[愿得一人] 2020-12-01 02:17

I am trying to parse a feed from a json webservice on my iPhone however the utf8 conversion is not working the way it should or am I doing something wrong Here is apart of

4条回答
  •  自闭症患者
    2020-12-01 02:59

    After much grief I have figured this out. Use this.

    NSString *correctString = [NSString stringWithCString:[utf8String cStringUsingEncoding:NSISOLatin1StringEncoding] encoding:NSUTF8StringEncoding];
    

提交回复
热议问题