2012-10-29 45 views

回答

2

可能它只是爲了更好地與這樣的轉義:

NSString *unescaped = @"http://www"; 
NSString *escapedString = (NSString *)CFURLCreateStringByAddingPercentEscapes(
    NULL, 
    (CFStringRef)unescaped, 
    NULL, 
    (CFStringRef)@"!*'();:@&=+$,/?%#[]", 
    kCFStringEncodingUTF8); 

NSLog(@"escapedString: %@",escapedString); 

,因爲它stated here

或者你可以剝離! *'(); :@ & = + $,/? %#[]個字符,如果你願意的話。 查看here for a list of reserved characters

+0

我現在替換'!*'();:@&= + $,/?%#[]'個字符。謝謝 – fabian789

相關問題