Why does the JavaScript function encodeURIComponent encode spaces to the hex Unicode value %20 instead of +. Should URI parameters not spaces to +?
Why does the JavaScript function encodeURIComponent encode spaces to the hex Unicode value %20
Share
Spaces encode to %20, I believe that’s their ASCII character code.
However, developers have taken a shine to encoding spaces to + because it generates URLs that are readable and typeable by human beings.