S
S
Stanislav2021-07-17 20:52:47
Express.js
Stanislav, 2021-07-17 20:52:47

How to solve problems with Russian characters in the URL string?

I decided to change the URL of the sections
Now I send data to the page with a request like this
/search/?q=sneakers
At the same time, I write a banal path in the router as /search/, and then I just find q in request.query and everything is buzzing
I want to do this
/search/ sneakers/
At the same time, you need to write a regular expression in the router in the form
/search/:q([а-яё]+)/
But the node does not see such a page, you see, because it converts the URL and processes the word sneakers as %D0%BA%D1% 80%D0%BE%D1%81%D1%81%D0%BE%D0%B2%D0%BA%D0%B8

How can I solve this problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question