Joke Collection Website - Joke collection - JavaScript gbk to utf 8 encoding problem

JavaScript gbk to utf 8 encoding problem

The encodeuricomponent and decodeuricomponent functions

The former is encoding, and the latter is decoding.

It's not about gbk to utf-8, remember, don't say that next time, so as not to make a joke

Example:

alert(encodeuricomponent('I One kick'));

alert(decodeuricomponent(encodeuricomponent('I have one kick')));