Skip to content

Instantly share code, notes, and snippets.

@mdjhny
Created August 13, 2013 12:00
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 mdjhny/6220412 to your computer and use it in GitHub Desktop.
Save mdjhny/6220412 to your computer and use it in GitHub Desktop.
判断字符是否为中文
def is_cn_char(i):
return 0x4e00<=ord(i)<0x9fa6
def is_cn_or_en(i):
o = ord(i)
return o<128 or 0x4e00<=o<0x9fa6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment