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

  • one
    Well, actually, everything is very coded there as dns-shop.ru/search/?q=%D1%82%D0%B5%D1%81%D1%82%21 - just the browser in the address bar specifically decodes the user It was beautiful - andreymal
  • And why do you need to do this? Without knowing this, it is not entirely clear what to do. - Bharata
  • Same as in the example, I need to generate a Russian-human-readable url from the search results for the store, as in the example dns-shop.ru/search/?q=test% 21 . You can, of course, encode hands, but the option should be easier. - Alexander Sutyrkin
  • one

0