#pragma mark - url 中文格式化
+ (NSString *)strUTF8Encoding:(NSString *)str
{
/*! ios9适配的话 打开第一个 */
if ([[UIDevice currentDevice] systemVersion].floatValue >= 9.0)
{
return [str stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
}
else
{
return [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}
}
网友评论