pip install Unidecode python from unidecode import unidecode ascii_sentence = unidecode(sentence) print(ascii_sentence) Wo Ai Python Bian Cheng python from unidecode import unidecode with open('chinese_text.txt', 'r', encoding='utf-8') as file: text = file.read() ascii_text = unidecode(text) with open('ascii_text.txt', 'w', encoding='utf-8') as file: file.write(ascii_text)


上一篇:
下一篇:
切换中文