MostafaElAyoubi / Data-shapes

code for revit, dynamo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chinese characters skipping in TreeView input

nodatasheet opened this issue · comments

Hi!

Suddenly in all my scripts TreeView input started skipping Chinese characters.

I suspect it happens because of the remove_accents() function.

Changing it to this code, fixed my issue:

def remove_accents(input_str):
    # type: (str) -> str
    """Normalize unicode string.
    Second solution from here:
    https://stackoverflow.com/a/517974"""
    nfkd_form = unicodedata.normalize('NFKD', input_str)
    return u"".join([c for c in nfkd_form if not unicodedata.combining(c)])

If it is not just me and actually solves the problem, please consider adding it to your next version.