Post

Replies

Boosts

Views

Activity

Reply to URL Encoding doesn't work with iOS 17 which is working with iOS 16
I had the same problem and it was due to this change that query parameters are now automatically encoded, although my parameter was already url-encoded. However, upon further inspection using the init(string:encodingInvalidCharacters:) initializer and passing encodingInvalidCharacters: false as suggested in the documentation I found out my parameter did not encode all invalid characters (in my case, block quotes). It returned nil, meaning the param did still contained invalid characters. As soon as I made sure my param string was completely url-encoded, the default initializer on iOS 17 no longer double-encoded. I guess as soon it finds some unencoded character it blindly encodes the whole url.
Nov ’23