Skip to content

Instantly share code, notes, and snippets.

@JafarAkhondali
Last active February 22, 2023 09:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JafarAkhondali/bb262900095dacc48dc9080c214306fb to your computer and use it in GitHub Desktop.
Save JafarAkhondali/bb262900095dacc48dc9080c214306fb to your computer and use it in GitHub Desktop.
Finds all unicode characters that produce at least one character in ASCII range when converted to Uppercase or Lowercase.
"""
Finds all unicode characters that produce at least one character in ASCII range when converted to Uppercase or Lowercase.
Result:
Char ß with code(223) to uppercase contains ASCII char(S). Full uppercase: SS
Char ß with code(223) to uppercase contains ASCII char(S). Full uppercase: SS
Char İ with code(304) to lowercase contains ASCII char(i). Full lowercase: i̇
Char ı with code(305) to uppercase contains ASCII char(I). Full uppercase: I
Char ʼn with code(329) to uppercase contains ASCII char(N). Full uppercase: ʼN
Char ſ with code(383) to uppercase contains ASCII char(S). Full uppercase: S
Char ǰ with code(496) to uppercase contains ASCII char(J). Full uppercase: J̌
Char ẖ with code(7830) to uppercase contains ASCII char(H). Full uppercase: H̱
Char ẗ with code(7831) to uppercase contains ASCII char(T). Full uppercase: T̈
Char ẘ with code(7832) to uppercase contains ASCII char(W). Full uppercase: W̊
Char ẙ with code(7833) to uppercase contains ASCII char(Y). Full uppercase: Y̊
Char ẚ with code(7834) to uppercase contains ASCII char(A). Full uppercase: Aʾ
Char K with code(8490) to lowercase contains ASCII char(k). Full lowercase: k
Char ff with code(64256) to uppercase contains ASCII char(F). Full uppercase: FF
Char ff with code(64256) to uppercase contains ASCII char(F). Full uppercase: FF
Char fi with code(64257) to uppercase contains ASCII char(F). Full uppercase: FI
Char fi with code(64257) to uppercase contains ASCII char(I). Full uppercase: FI
Char fl with code(64258) to uppercase contains ASCII char(F). Full uppercase: FL
Char fl with code(64258) to uppercase contains ASCII char(L). Full uppercase: FL
Char ffi with code(64259) to uppercase contains ASCII char(F). Full uppercase: FFI
Char ffi with code(64259) to uppercase contains ASCII char(F). Full uppercase: FFI
Char ffi with code(64259) to uppercase contains ASCII char(I). Full uppercase: FFI
Char ffl with code(64260) to uppercase contains ASCII char(F). Full uppercase: FFL
Char ffl with code(64260) to uppercase contains ASCII char(F). Full uppercase: FFL
Char ffl with code(64260) to uppercase contains ASCII char(L). Full uppercase: FFL
Char ſt with code(64261) to uppercase contains ASCII char(S). Full uppercase: ST
Char ſt with code(64261) to uppercase contains ASCII char(T). Full uppercase: ST
Char st with code(64262) to uppercase contains ASCII char(S). Full uppercase: ST
Char st with code(64262) to uppercase contains ASCII char(T). Full uppercase: ST
"""
import string
for i in range(1, 2**16):
ch = chr(i)
if ch in string.ascii_letters:
continue
upper_ch = ch.upper()
lower_ch = ch.lower()
for c in upper_ch:
if c in string.ascii_letters:
print(f"Char {ch} with code({i})\t to uppercase contains ASCII char({c}). Full uppercase: {upper_ch} ")
for c in lower_ch:
if c in string.ascii_letters:
print(f"Char {ch} with code({i})\t to lowercase contains ASCII char({c}). Full lowercase: {lower_ch} ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment