Skip to content

Instantly share code, notes, and snippets.

@Huskie
Created April 17, 2015 09:16
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 Huskie/c174d2df95d787c1327c to your computer and use it in GitHub Desktop.
Save Huskie/c174d2df95d787c1327c to your computer and use it in GitHub Desktop.
Detect whether character is 16 or 32 bit
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