C#中正确的方法是将拉丁连字母(例如œ)扩展到其在UTF-8空间(OE)中的组件字符?
我有一个用例,其中包含拉丁连字的字符串,例如 - 或æ,以及其变节,需要在UTF-8角色空间下将其扩展的对应物转换为其扩展的对应物。在这种情况下,Unicode字符æ
(u+00e6)和变性变体,例如µ
,ǽ
和 应替换为
ae
;也应尊重大写。
可以使用某种静态翻译结构来实现幼稚的解决方案,但从长远来看,这感觉很脆弱。
那么,建议实现此字符串翻译的正确方法是什么?
I have a use case where strings containing latin ligatures, like œ or æ, as well as its diacritics, require translation to their expanded counterparts available under UTF-8 character space. In this scenario, the unicode character æ
(U+00E6) and diacritic variants like æ̃
, ǽ
and ǣ
should be replaced with ae
; capitalization should also be respected.
A naive solution could be implemented using a static translation structure of some sort, but that feels brittle and not sustainable in the long term.
So what would be the recommended, correct way to implement this string translation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论