ios Swift3 处理Url中文乱码崩溃

var url = “http://www.baidu.com/test=中文乱码的问题”

var urlString = url.addingPercentEncoding(withAllowedCharacters:.urlHostAllowed)

var request = URLRequest(url: URL(string: urlString))

你可能感兴趣的:(ios Swift3 处理Url中文乱码崩溃)