If you judge that url contains words?

for example, this one contains Korean

https://weixin.sogou.com/weixin?type=2&ie=utf-8&s_from=hotnews&query=.

Vietnamese:

https://weixin.sogou.com/weixin?type=2&ie=utf-8&s_from=hotnews&query=Ti

I need to judge that if the URL does not contain text, then I do not need encodeURIComponent processing.
if it contains text, it is processed with encodeURIComponent. But how to judge whether it contains these words is a problem. Most of them just find out how to judge Chinese on the Internet.

< hr >

I found that I really asked a stupid question. Just use the function encodeURI directly, such as

.

url = encodeURI(url);

Dec.31,2021

so troublesome, will it be a problem to deal with it directly?
most of this can be judged. Click to view

.
^https?:\/\/[!-~]+?&query=(?=.*[^!-~]).+$

judge Korean:

 

encodeURI

just judge directly, but it's not too troublesome to judge in reverse.

Menu