移除Python unicode字符串中的重音符号(规范化)的最佳方法是什么?

移除Python unicode字符串中的重音符号(规范化)的最佳方法是什么?,第1张

移除Python unicode字符串中的重音符号(规范化)的最佳方法是什么?

Unidepre是正确的答案。它将所有unipre字符串音译为ASCII文本中最接近的可能表示形式。

例:

accented_string = u'Málaga'# accented_string is of type 'unipre'import unidepreunaccented_string = unidepre.unidepre(accented_string)# unaccented_string contains 'Malaga'and is of type 'str'


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5655610.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存