标签:
旧方法
NSString *encoded = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
iOS9 之后的 新方法
// NSString *encoded = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
// [NSCharacterSet URLQueryAllowedCharacterSet];
标签:
原文地址:http://www.cnblogs.com/KiVen2015/p/5825424.html