Last active
February 14, 2018 16:11
-
-
Save RamonYeung/a76da61987d7e4d652a0a65df7f1a7e0 to your computer and use it in GitHub Desktop.
Display every Chinese character collected in Unicode char set.
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
# Recall that, in regex, we use [\u4e00-\u9fa5] to match chinese characters. | |
start = int("4e00", 16) | |
end = int("9fa5", 16) | |
for i in range(start, end + 1): | |
uni = r"\u" + hex(i)[2:] | |
result = uni.encode("utf-8").decode("unicode_escape") | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment