Delphi XE AnsiStrings与转义的组合变音符号

编程入门 行业动态 更新时间:2024-10-28 07:27:19
本文介绍了Delphi XE AnsiStrings与转义的组合变音符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

将Delphi XE AnsiString转换为Fu\0308rst的转义合并变音符号到最简单的WideStringFürst中的最佳方式是什么?

What is the best way to convert a Delphi XE AnsiString containing escaped combining diacritical marks like "Fu\u0308rst" into a frienly WideString "Fürst"?

我知道这并不总是可能的所有组合,但普遍的拉丁方块应该支持,而不建立愚蠢的转换表我自己。我想这个解决方案可以在新的Characters单元中找到,但是我不明白。

I am aware of the fact that this is not always possible for all combinations, but the common Latin blocks should be supported without building silly conversion tables on my own. I guess the solution can be found somewhere in the new Characters unit, but I don't get it.

推荐答案

我想你需要在您的字符串上执行 Unicode规范化。

I think you need to perform Unicode Normalization. on your string.

我不知道Delphi XE RTL中是否有一个特定的调用来执行此操作,但WinAPI调用 NormalizeString 应该在这里帮助你,模式NormalizationKC:

I don't know if there's a specific call in Delphi XE RTL to do this, but the WinAPI call NormalizeString should help you here, with mode NormalizationKC:

NormalizationKC

NormalizationKC

Unicode归一化形式KC,兼容性组合。转换每个基础加上组合字符到规范的预设等价的和所有兼容性字符到他们的等价物。例如,结扎fi成为f + i;同样,A +¨+ fi + n变为Ä+ f + i + n。

Unicode normalization form KC, compatibility composition. Transforms each base plus combining characters to the canonical precomposed equivalent and all compatibility characters to their equivalents. For example, the ligature fi becomes f + i; similarly, A + ¨ + fi + n becomes Ä + f + i + n.

更多推荐

Delphi XE AnsiStrings与转义的组合变音符号

本文发布于:2023-10-26 23:00:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531596.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:组合   符号   Delphi   XE   AnsiStrings

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!