伙计们,我已经尝试了所有但没有成功。
创建:
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:self.urlString]];
request.delegate = self;
[request setDefaultResponseEncoding:NSUTF8StringEncoding];
[request setResponseEncoding:NSUTF8StringEncoding];
[request setRequestMethod:@"PUT"];
[request addRequestHeader:@"Accept" value:@"application/xml"];
[request addRequestHeader:@"Content-Type" value:@"application/xml; charset=UTF-8;"];
显示:
- (void)requestFinished:(ASIHTTPRequest *)request
{
[self HideProgressing];
// NSString *poweredBy = [[request responseHeaders] objectForKey:@"X-Powered-By"];
// NSString *contentType = [[request responseHeaders] objectForKey:@"Content-Type"];
NSString *body = [request responseString];
//NSString *body = [[NSString alloc] initWithData:[request responseData] encoding:NSUTF8StringEncoding];
NSLog(@"%@\n%@", body, request.responseStatusMessage);
甚至“内容类型”也表示它具有 UTF-8。但我只看到像“ዹ”这样的东西,而不是西里尔符号。
有人用编码解决了同样的问题吗?
数据来自 Basecamp API,如果有帮助的话。谢谢。