When I find a person of those challenges, I generally double encode the outcome (which turns %2f into %252f) for that API. On the other hand, this can crack other APIs which are not anticipating double encoding, so this is not a universal Remedy.The addition of toupper assures the case insensitivity expected by RFC 3986 irrespective of which Model