P
P
partyzanx2020-02-17 13:42:05
JavaScript
partyzanx, 2020-02-17 13:42:05

How to decode chinese characters url?

I send people this link http://www.hsk.wiki/search?term=玄玉瓜瓦甘生用甩田疋疒癶白皮皿目矛矢...

When they click on VK, for example, it opens

http://www.hsk.wiki/search?term=玄玉瓜瓦甘生用甩田疋疒癶白皮皿目矛矢石示礻禸禾穴立&strokeOrderAnimationButton=


And server scripts don't work.
How can I decode type characters &#29572into hieroglyphs (in this case &#29572= 玄) on the server side? So that I can then work with them on the server.
The server is written in node.js

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2020-02-17
@partyzanx

url.replace(/&#(.*?);/g, (match, g1) =>  String.fromCodePoint(g1))

like so?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question