NSString *url =@"www.haha.com/这是中文";
NSStringEncoding chineseEncoding = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
url = [url stringByAddingPercentEscapesUsingEncoding:chineseEncoding];
NSLog(@"%@",url);<br><br>
NSMutableURLRequest *request = [[NSMutableURLRequestalloc] init];
// 设置URL
[request setURL:[NSURL URLWithString:url]];
// 设置HTTP方法
[request setHTTPMethod:@"GET"];
// 发送同步请求, 这里得returnData就是返回得数据
NSData *data = [NSURLConnectionsendSynchronousRequest:request
returningResponse:nil error:nil];