Encounter a lost character to do, because the characters are usually not out of the common most of the time even the name can not shout out, so want to ask Baidu Google is not very likely. If it is small white users will definitely go to the Input method floppy disk open switch to another keyboard one to find. Even if there is Sogou input method such a powerful collection of special character sets, but also to find AH.
That day on GitHub on the time of the careless error page (you still dispel the idea of repetition, it is difficult), a bullish chic, I go, sigh with question mark of the fit, I go what is this symbol?
What also table said maybe later in their own design to use, so copy down.
Later a think ah wrong ah, I can not play out, I want to use the time must be copied. This is not very safe. If you know his Unicode code, then you can use it in Html,javascript.
So now you need a function that can convert a character to a Unicode code.
The JavaScript built-in function has a string.fromcharcode () that turns Unicode into characters.
There's also a string.charcodeat () that representable Unicode to a character.
But note that this string.charcodeat () directly turns out the number is 10 binary, cannot in code like this normal use "\uxxxx".
So you need to call ToString (16), and note that you specify a base of 16.
The following auxiliary functions are then obtained:
function convert2unicode (char) { returnchar. charCodeAt (0). ToString (+);}
Convert2unicode ("?") "\u203d"
So it can be used in JS: alert ("\u203d");
Advanced
Further, it can be thought that in addition to converting a character to a Unicode representation, a string can be converted with a slight modification.
function Tounicode (thestring) { var unicodestring = '; for (var i = 0; i < thestring.length; i++) { var theunicode = Thestring.charcodeat (i). ToS Tring (+). toUpperCase (); while (Theunicode.length < 4) { = ' 0 ' + theunicode; } = ' \\u ' + theunicode; + = Theunicode ; } return unicodestring;}
The
JavaScript word representable Unicode, by the way: GitHub's Oh no page is very bright