c++ - 阿拉伯语: 'source' Unicode 到最终显示的 Unicode

标签 c++ c arabic

简单的问题:

这是我要找的最终显示字符串

لعبة ديدة

下面是每个单独的字符,在“粘合”在一起之前(所以我在每个字符之间放置了一个空格以停止连接)

ل ع ب ة د ي د ة

请注意它们不是相同的字符,有一些神奇的转换将它们融合在一起并将它们转换为新的 Unicode 字符。

然后在上面,字符实际上是从右到左出现的(在内存中,它们是从左到右)

所以我的简单问题是:我从哪里获得一个独立于平台的 c/c++ 函数,它将采用我的源 16 位 Unicode 字符串,并对其进行转换以生成将创建第一个引用的 Unicode 字符串多于?进行 RTL 转换和连接?

这就是我想要的,一个函数就可以做到这一点。

更新:

好的,是的,我知道上面两个示例中的“字符”是相同的,它们是相同的“字母”但是(在 chrome 或最新的 IE 中查看)任何人都可以清楚地看到字形不同。现在我相当有信心需要完成的这个转换可以在 unicode 级别完成,因为我的字体文件和 unicode 标准似乎为字符的单独和各种连接版本指定了不同的字形/字母。 (unicode.org/charts/PDF/UFB50.pdf unicode.org/charts/PDF/UFE70.pdf)

那么,我可以将我的 unicode 放入一个函数中,然后得到转换后的 unicode 吗?

最佳答案

连接和 RTL 转换不会发生在 Unicode 字符级别。

换句话说:字符的顺序实际的unicode代码点在这个过程中没有改变。

实际上,合并和处理 RTL/LTR 转换是由文本渲染引擎处理的。

这句话来自the Wikipedia article on the Arabic alphabet很好地解释了它:

Finally, the Unicode encoding of Arabic is in logical order, that is, the characters are entered, and stored in computer memory, in the order that they are written and pronounced without worrying about the direction in which they will be displayed on paper or on the screen. Again, it is left to the rendering engine to present the characters in the correct direction, using Unicode's bi-directional text features. In this regard, if the Arabic words on this page are written left to right, it is an indication that the Unicode rendering engine used to display them is out-of-date.

关于c++ - 阿拉伯语: 'source' Unicode 到最终显示的 Unicode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7803960/

相关文章:

c++ - char* 丢失数据

javascript - Unicode 字符串替换不适用于完整的变音符号阿拉伯文本

date - 带有阿拉伯数字的回历、格里高利日期和时间

c++ - C++中的unique_lock和shared_lock有什么区别

c++ - Qt C++ : static assertion failed: Signal and slot arguments are not compatible

c++ - 创建类似 AirPlay 的 Web 协议(protocol)

c - 瓦尔格林德 C : Argument of function has a fishy (possibly negative) value

android - 如何在 Android 中显示阿拉伯文文本?

c++ - 如何从文件中读取整行(带空格)?

c++ - 添加自定义稀疏操作(稀疏行列式)