Skip to content

Instantly share code, notes, and snippets.

@taizooo
Created November 1, 2010 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save taizooo/657709 to your computer and use it in GitHub Desktop.
Save taizooo/657709 to your computer and use it in GitHub Desktop.
javascript:
'search_unicode.bookmarklet.js',
(function(){
var x='http://www.fileformat.info/info/unicode/char/'+(function(r){
var n=r.startContainer,
p=r.startOffset,
u=(n.nodeType==3)?n.nodeValue.substr(p,2):n.childNodes[p].textContent.substr(0,2),
v=u.charCodeAt(0);
return 0xD800<=v&&v<=0xDB7F?((v&0x3FF)<<10|u.charCodeAt(1)&0x3FF)+0x10000:v;
})(getSelection().getRangeAt(0)).toString(16)+'/index.htm';
window.open(x);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment