Started work on Ember
This commit is contained in:
9
util/str_compare.py
Normal file
9
util/str_compare.py
Normal file
@ -0,0 +1,9 @@
|
||||
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)
|
Reference in New Issue
Block a user