检索Unicode代码点> QChar的U + FFFF [英] Retrieve Unicode code points > U+FFFF from QChar

查看:146
本文介绍了检索Unicode代码点> QChar的U + FFFF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应处理各种字符并在某些时候显示有关它们的信息的应用程序.我在QChar,QString等中使用Qt及其固有的Unicode支持.

I have an application that is supposed to deal with all kinds of characters and at some point display information about them. I use Qt and its inherent Unicode support in QChar, QString etc.

现在,我需要QChar的代码点才能在 http:/中查找某些数据/unicode.org/Public/UNIDATA/UnicodeData.txt ,但是QChar的unicode()方法仅返回ushort(无符号短),通常为0到65535(或0xFFFF)之间的数字.有些字符的代码点> 0xFFFF,那么如何获得这些字符呢? Qt/QChar目前不支持某些技巧吗?

Now I need the code point of a QChar in order to look up some data in http://unicode.org/Public/UNIDATA/UnicodeData.txt, but QChar's unicode() method only returns a ushort (unsigned short), which usually is a number from 0 to 65535 (or 0xFFFF). There are characters with code points > 0xFFFF, so how do I get these? Is there some trick I am missing or is this currently not supported by Qt/QChar?

推荐答案

每个QChar是UTF-16值,而不是完整的Unicode代码点.因此,非BMP字符由两个QChar代理对组成.

Each QChar is a UTF-16 value, not a complete Unicode codepoint. Therefore, non-BMP characters consist of two QChar surrogate pairs.

这篇关于检索Unicode代码点> QChar的U + FFFF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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