views:

83

answers:

1

In google translate web site if i type any word in English and select any other foreign language, it show the exact word in the foreign language. I want the unicode value of that foreign characters. How to get that?

+2  A: 

Select 1 character (e.g. "香") then type this into the location bar:

javascript:alert("香".charCodeAt(0).toString(16))

then press Enter.


You can also use this bookmarklet:

javascript:var%20s=window.getSelection().toString(),t=[];for(var l=0;l<s.length;++l)t.push(s.charAt(l)+"="+s.charCodeAt(l).toString(16));alert(t.join("\n"))
KennyTM
Is that code point *really* 9999? Because that's what Chrome and Firefox tell me. IE just ignores me unless I put it in a file as a link, and it says the same thing. Suggests that while being nice and direct, it may not be entirely accurate. Worked fine with ě from Czech (code point 011b).
T.J. Crowder
Cool bookmarklet. You want `%20` after `var` (not a space).
T.J. Crowder
@T.J. http://www.fileformat.info/info/unicode/char/9999/index.htm
KennyTM