ARandomControl
ARandomControl

Reputation: 1

How do I get the UTF code value "0041" from "A" by using only Javascript?

Conversely, how do I get "0031" from "1"; or "5185" from "内".

I know you can use codePointAt() to get the unique HTML entity code (in the case of A, it returns "65"), but I don't seem to find a way to bring out the other value, which I don't even know the name of.

It's the value shown here or here at the "UTF-16 Encoding" row

Upvotes: 0

Views: 21

Answers (0)

Related Questions