replaceAll not working ( I think so )
with + like a real browser.
Here is a quick overview on UTF-8
You are probably using chrome. You are probably thinking that this:
is correct syntax for UTF-8. But you are 50% wrong.
%20 means space in UTF8 so when your browser reads the GET parameters it will just read exactly what you searched in the input.
It replaces the space with %20
Hi, instead of using replaceAll, try using
do take note of the
g flag, that makes it so replace tries to match as many times as possible. Without it, it will only match the first one.
encodeURIComponent() encodes the % signs in %20, so
'a%2520a'. Instead of
encodeURIComponent(search).replaceAll("%20", "+"), use