//NSString 转化NSURL有中文 (转成UTF8)
//之前使用(iOS9 弃用了)
- (nullableNSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)encNS_DEPRECATED(10_0,10_11, 2_0,9_0, "Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid.");
//使用(iOS9之后使用)
NSString *str =@"ios://ShopVC?categoryId=2&category=哈哈";
NSString *string=[strstringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSetURLQueryAllowedCharacterSet]];
NSURL *url = [NSURLURLWithString:string];