Why is %2526
used instead of %26
to encode an &
?
Im invoking a URL to an external site and when I encode the &
as %2526
the parameters are passed correctly but when I just use %26
they are not.
URL Encoding (Percent Encoding) URL encoding converts characters into a format that can be transmitted over the Internet. URLs can only be sent over the Internet using the ASCII character-set. Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.
is a reserved separator character that cannot appear unencoded in the name and value fields, it must be url-encoded as %3D : custom_field_id%5B%5D%3D10=custom_field_value_10%3DFull-time. It is the receiver's responsibility to url-decode the submitted data before then processing it.
A space is assigned number 32, which is 20 in hexadecimal. When you see “%20,” it represents a space in an encoded URL, for example, http://www.example.com/products%20and%20services.html.
If you url-encode an ampersand you get %26
. If you url-encode %26
you get %2526
. Thus, it is url-encoded twice.
%25
is the percent character, so %2526
URLDecoded results in
%26
which URLDecoded results in
&
For some reason, the call you make seems to require doubly percent encoded input. Without knowing more about what you're doing, it's impossible to know why, but I guess all is in order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With