Skip to content

Instantly share code, notes, and snippets.

@Shellbye
Created October 24, 2016 05:38
Show Gist options
  • Select an option

  • Save Shellbye/b85eeec78a46fbe6350fb01324327d4c to your computer and use it in GitHub Desktop.

Select an option

Save Shellbye/b85eeec78a46fbe6350fb01324327d4c to your computer and use it in GitHub Desktop.
check if a char is chinese or not
def is_chinese(text_1):
if isinstance(text_1, str):
text_1 = text_1.decode('utf-8')
return u'\u4e00' <= text_1 <= u'\u9fff'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment