Last active
December 29, 2016 20:06
-
-
Save awn-git/4c11c82c1e433f10af08f2979c740cd0 to your computer and use it in GitHub Desktop.
文字列をいい感じに調べるスニペット
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function searchUnicode(strs){ | |
let charcodes = strs.split("").map((s) => {return s.charCodeAt();}); | |
let charhex = charcodes.map((s) => {return s.toString(16);}); | |
for(let ix = 0, len = charcodes.length; ix < len; ix++){ | |
console.log(`${strs[ix]} = ${charcodes[ix]}(U+${charhex[ix]}): http://www.fileformat.info/info/unicode/char/${charhex[ix]}/index.htm`); | |
} | |
return [charcodes, charhex]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment