Created
January 10, 2013 08:53
-
-
Save sporty/4500569 to your computer and use it in GitHub Desktop.
文字の全角チェック
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
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