Skip to content

Instantly share code, notes, and snippets.

@sporty
Created January 10, 2013 08:53
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 sporty/4500569 to your computer and use it in GitHub Desktop.
Save sporty/4500569 to your computer and use it in GitHub Desktop.
文字の全角チェック
import unicodedata
def is_zenkaku(c):
"""
指定された文字が全角ならば真
@param c unicode文字
"""
wide_chars = u"WFA"
eaw = unicodedata.east_asian_width(c)
if wide_chars.find(eaw) > -1:
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment