我解析使用NSURLConnection的,像這樣的一些明文/ HTML:解析HTML /明文通過HTTP使用Objective-C - 文本編碼問題
NSURLResponse *response;
NSData *result = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
//I should find a better way to convert this string
NSString *content = [NSString stringWithCString:[result bytes]];
我一直在使用這兩種stringWithCString和stringWithUTF8String審判,我仍然得到怪異對於像"
或'
這樣的特殊字符,HTML格式可能會如此。
我敢肯定,有一些非常明顯的更好的方式來解碼文本,但我真的是新的ObjC和有點失去了什麼谷歌。