在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://www.54852.com/zaji/4931048.html

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

发表评论

登录后才能评论

评论列表(0条)

    保存