Created
April 17, 2015 09:16
-
-
Save Huskie/c174d2df95d787c1327c to your computer and use it in GitHub Desktop.
Detect whether character is 16 or 32 bit
This file contains 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
var is32Bit = function (c) { | |
return c.codePointAt(0) > 0xFFFF; | |
} | |
console.log(is32Bit('𠮷')); // true | |
console.log(is32Bit('a')); // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment