Skip to content

Instantly share code, notes, and snippets.

@Boldewyn
Forked from taizooo/search_unicode.bookmarklet.js
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Boldewyn/9226678 to your computer and use it in GitHub Desktop.
Save Boldewyn/9226678 to your computer and use it in GitHub Desktop.
Via @taizooo and http://d.hatena.ne.jp/mandel59/20091125/1259157800 adapted from fileformat.info to codepoints.net
javascript:
'search_unicode.bookmarklet.js',
(function(){
var x='http://codepoints.net/U+'+(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);
window.open(x);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment