Hi guys. After updating to Xcode 15.3, we encountered a new issue regarding NSURL.
The page states, “For apps linked on or after iOS 17 and aligned OS versions, NSURL parsing has been updated from the obsolete RFC 1738/1808 parsing to the same RFC 3986 parsing as NSURLComponents. This unifies the parsing behaviors of NSURL and NSURLComponents APIs. Now, it automatically percent- and IDNA-encodes invalid characters to help create a valid URL.”
On devices running iOS 17, when the request URL is passed to the UnityCreateWebRequestBackend method in UnityWebRequest.mm, the ‘[ ]’ characters in the query part are not encoded as %xx, which is recognized as containing invalid characters. As a result, the system automatically re-encodes all characters in the query part, causing double encoding and leading to server-side parsing failure and errors.
Our solution is to modify the code as shown in the red box in the image below. We first decode the URL, and then the system automatically encodes all characters in the query part. This way, only one encoding occurs, and the server can parse it correctly.
