I have a string which is encrypted which looks like this
Pfx32q+xLq4R+VocXy4IC8aQNdmFqdA284THap54Bl4= On encrypting this string we call the HttpUtility.UrlEncode("Pfx32q+xLq4R+VocXy4IC8aQNdmFqdA284THap54Bl4=") passing the encrypted string as a parameter this returns a value
Pfx32q%2BxLq4R%2BVocXy4IC8aQNdmFqdA284THap54Bl4%3D where in + is replace with %2 etc and so on on my development system but when the same code is run on a production server the plus does not get encoded instead it remains as + .
We are not able to point out what really is causing this . Is there a scenario or a case where in on calling of the HttpUtility.UrlEncode method the characters like + do not get encoded ?
+is also a valid character for url that is the reason it is not being encoded here is the base URI definition+characters. SeeIsUrlSafeCharhere referencesource.microsoft.com/#System/net/System/Net/… The+is explicitly mentioned in the comment as being escaped in spite of the RFC rules.