解決URL二次編碼的問題
想來想去 終於想到一個解決辦法
urlString = [urlString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //先去進行解碼
// NSString *str = @"i'm a 蘋果。...";
for(int i=0; i< [urlString length];i++){
int a = [urlString characterAtIndex:i];
if( a > 0x4e00 && a < 0x9fff) {
NSLog(@"漢字");
urlString = [urlString
break;
}
}
NSURLRequest *request = [[NSURLRequestalloc] initWithURL:[NSURLURLWithString:urlString]];
[self.browseViewloadRequest:request];
[self.addressBardisplayProgress:0.2];