0

hi I want to receive image from a source but I realized it has some characters that swift Urlsession return nil on the I want to know how can I change this url

https://melovaz.net/wp-content/uploads/2019/12/¡Viva-Latino-2.jpg

to

https://melovaz.net/wp-content/uploads/2019/12/%C2%A1Viva-Latino-2.jpg

using swift so I can download the image thank you

mahad shahib
  • 300
  • 2
  • 12

1 Answers1

0

thank to this post this post

I should use

var urlString = originalString.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
mahad shahib
  • 300
  • 2
  • 12