[Swift]NSURL中文编码
2016-10-21 本文已影响0人
鄒賢
// Swift2.0
let urlEncodeString = urlString.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet()) (已弃用)
// Swift3.0
let urlEncodeString = urlString.addingPercentEncoding(withAllowedCharacters: NSCharacterSet.urlQueryAllowed)