如何获取c ++中unicode字符的十进制值 [英] How to get decimal value of a unicode character in c++

查看:118
本文介绍了如何获取c ++中unicode字符的十进制值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的一个开源项目,我需要计算一个给定unicode字符的十进制等价。

For one of my opensource projects, i need to compute the decimal equivalent of a given unicode character.

例如如果tamil字符 L 'அ',输出应为2949。

For example if tamil character L'அ' is given, the output should be 2949 .

我在Qt环境中使用c ++。我google了,找不到一个解决方案。如果您知道此解决方案,请帮助。

I am using c++ in Qt environment. I googled and could not find a solution for this. Please help if you know a solution for this.

推荐答案

使用 QChar 对象(您可以使用<$ c $>)获取 / com / 4.4 / qchar.html#unicode-2> unicode如果 QString 是您必须开始的,则 与)。

Use the unicode() method of the QChar object (which you can get e.g. with the at method of a QString, if a QString is what you have to start with).

这篇关于如何获取c ++中unicode字符的十进制值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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