Closed ShortByte closed 3 years ago
.replaceAll(" ", "+")
for in the end also a regex.
I also added the & character, otherwise it would cause problems with query building.
%
=> %25
$
=> %24
@
=> %40
also
?
=> %3F
#
=> %23
^
=> %5E
=
=> %3D
,
=> %2C
What about encodeURIComponent(query).replaceAll("%20", "+")
?
I was just thinking the same thing. Since I had tested in the browser and had considered that the browser itself replaces the special characters. Should I push this solution?
I guess
I just noticed again that replaceAll
does not exist in JavaScript. I remembered it also from Java.
lgtm
The query search for the Youtube URL has been changed. The Youtube URL is built differently and does not use the standard URL encoding. In the query part only the spaces are changed to + characters.
This extremely changes the search results and you get wrong answers.