The js string and Unicode encoding convert each other, And the js string unicode
'Ha'. charCodeAt (0). toString (16) "597d"
This code indicates converting the character 'hao' into Unicode encoding,
Let's see what charCodeAt () means.
The charCodeAt () method returns the Unicode encoding of characters at the specified position. The returned value is an integer between 0 and 65535.
It is equal to a single character in 'charcodeat,
'Good. 'charCodeAt (0). toString (16) "597d" 'Good.' charCodeAt (1). toString (16) "54e6"
The code above shows that you want to know the encoding of a single character by using this parameter, that is, the index.
What if I want to decode unicode into characters?
To decode Unicode, you must use the Escape Character '\ U'
'\ U54e6' "Oh"
After unicode and character escape
Let's talk about the substantive concept.
Js unicode is a string prefixed with a hexadecimal code plus a \ u table. \ Unnnn
Unicode is generated to address the limitations of traditional character encoding schemes. It sets a uniform and unique binary encoding for each character in each language, to meet the requirements of cross-language and cross-platform text conversion and processing. R & D started in December 1990 and officially announced in December 1994. [1]
The above is all the content of this article. I hope this article will help you in your study or work. I also hope to provide more support to the customer's home!