9 lines
262 B
Python
9 lines
262 B
Python
import unicodedata
|
|
|
|
def normalize_caseless(text):
|
|
return unicodedata.normalize("NFKD", text.casefold())
|
|
|
|
def unicode_compare_ignore_case(str1, str2):
|
|
str1 = normalize_caseless(str1)
|
|
str2 = normalize_caseless(str2)
|
|
return (str1>str2) - (str1<str2) |