我們正在使用XML/NSMutableURLRequest將內容從我們的網站上拉下來,有時它會通過「捲曲」式撇號和引號「而不是」拉動內容。 NSMutableURLRequest似乎討厭這些,並把它們變成奇怪的\ U00e2 \ U0080 \ U0099字符串。iphone:NSMutableURLRequest爲MS Word風格的撇號返回奇怪的字符
有什麼我可以做的,以防止這種情況?我正在使用GET方法,所以我應該以某種方式告訴它使用UTF-8?或者,我錯過了什麼?
UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = YES;
NSString *urlStr = [NSString stringWithFormat:@"%@",url];
NSURL *serviceUrl = [NSURL URLWithString:urlStr];
NSMutableURLRequest *serviceRequest = [NSMutableURLRequest requestWithURL:serviceUrl];
[serviceRequest setHTTPMethod:@"GET"];
NSURLResponse *serviceResponse;
NSError *serviceError;
app.networkActivityIndicatorVisible = NO;
return [NSURLConnection sendSynchronousRequest:serviceRequest returningResponse:&serviceResponse error:&serviceError];
你能張貼有關問題的代碼? – Alex 2011-01-25 18:58:59
更新了我的帖子... – 2011-01-25 19:32:35