Skip to content

Instantly share code, notes, and snippets.

@pocotan001
Created February 17, 2016 09:35
Show Gist options
  • Save pocotan001/4b64598c6efd114a663f to your computer and use it in GitHub Desktop.
Save pocotan001/4b64598c6efd114a663f to your computer and use it in GitHub Desktop.
コードポイントから絞る簡易版。→のがちゃんとしてる https://github.com/komagata/eastasianwidth
// Basic Latin (0000–007F) http://unicode.org/charts/PDF/U0000.pdf
// Halfwidth Katakana (FF61–FF9F) http://unicode.org/charts/PDF/UFF00.pdf
function isHalfWidth(string) {
return /[\u0000-\u007f\uff61-\uff9f]/.test(string);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment