Created
November 1, 2016 06:02
-
-
Save kitak/8061227228bef920b42d4ed6dd151c80 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
String.fromCodePoint(parseInt("1f376", 16)) | |
String.fromCodePoint(0x1F376) | |
// "🍶" | |
Array.from("🍶🍣") | |
// ["🍶", "🍣"] | |
"🍶".codePointAt(0).toString(16) | |
// "1f376" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
勉強になる http://teppeis.hatenablog.com/entry/2014/01/surrogate-pair-in-javascript