It is necessary to encode the string "test!" in the url with the text "test% 21", in fact it turns out to be "% D1% 82% D0% B5% D1% 81% D1% 82% 21".
I use encodeURI (), is there something similar in JS, but allowing Russian characters?
Here is an example where everything works fine:
We write in the search for any phrase, at the output we get about the following url (not advertising): https://www.dns-shop.ru/search/?q=test%21