如何将变音符号更改为非变音符号 [英] How to change diacritic characters to non-diacritic ones

查看:33
本文介绍了如何将变音符号更改为非变音符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经找到了如何在 stackoverflow 上删除变音符号的答案,但是您能否告诉我是否可以将变音符号更改为非变音符号?

I've found a answer how to remove diacritic characters on stackoverflow, but could you please tell me if it is possible to change diacritic characters to non-diacritic ones?

哦.. 我考虑过 .NET(或其他,如果不可能的话)

Oh.. and I think about .NET (or other if not possible)

推荐答案

Copying from 我自己对另一个问题的回答:

Copying from my own answer to another question:

不是创建自己的表格,而是将文本转换为规范化形式 D,其中字符表示为基本字符加上变音符号(例如,á"将被替换为a",后跟一个结合尖锐的口音).然后,您可以删除所有不是 ASCII 字母的内容.

Instead of creating your own table, you could instead convert the text to normalization form D, where the characters are represented as a base character plus the diacritics (for instance, "á" will be replaced by "a" followed by a combining acute accent). You can then strip everything which is not an ASCII letter.

这些表格仍然存在,但现在是来自 Unicode 标准的表格.

The tables still exist, but are now the ones from the Unicode standard.

您也可以尝试使用 NFKD 代替 NFD,以捕获更多案例.

You could also try NFKD instead of NFD, to catch even more cases.

参考文献:

这篇关于如何将变音符号更改为非变音符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆