avian2 / unidecode

ASCII transliterations of Unicode text - GitHub mirror
https://pypi.python.org/pypi/Unidecode
GNU General Public License v2.0
516 stars 62 forks source link

Is there a way to transliterate European accent characters only, but leave Chinese characters as it is? #87

Open shivanraptor opened 1 year ago

shivanraptor commented 1 year ago

My code is as follow:

from unidecode import unidecode

s = "中文字café"

output = unidecode(s)
print(output)

It outputs Zhong Wen Zi cafe. Can the function only transliterate European accent characters only, but leave Chinese characters as it is?

Desired output: 中文字cafe

Thanks.