嗨,我想从源头接收图像,但我意识到它的某些字符会在Urlsession上迅速返回nil,我想知道如何更改此url
[https://melovaz.net/wp-content/uploads/2019/12/¡Viva-Latino-2.jpg
到
https://melovaz.net/wp-content/uploads/2019/12/%C2%A1Viva-Latino-2.jpg
快速使用,以便下载图像,谢谢
感谢此帖子this post
我应该使用
var urlString = originalString.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)