如何在C ++中使用Unicode [英] How to use Unicode in C++
本文介绍了如何在C ++中使用Unicode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好!
我有这个unicode:
$ b $b☹ - U + 2639
我怎么能在C ++中使用它?
注意:使用任何自定义库或类似的东西?
请帮助我!
我需要这么多我的项目。
Tnx。
Hello!
I have this unicode:
☹ - U+2639
How can I use it in C++?
NOTE: With any custom library or something like that?
Pls help me!
I need this so much for my project.
Tnx.
推荐答案
如果您使用的是Visual Studio,请确保您的项目 - >属性 - >一般 - >字符集已选择Unicode。然后,您可以使用字符串类的所有Unicode版本,并在Unicode字符串常量上使用L
前缀,例如:
If you are using Visual Studio then make sure that your Project -> Properties -> General -> Character Set has Unicode selected. Then you can use all the Unicode versions of the string classes, and use theL
prefix on your Unicode string constants like:
wstring myString = L"Hello, World! \u2639";
我还鼓励程序员使用库函数的TCHAR版本,根据项目设置转换为UNICODE或Ansi。
I would also encourage the programmer to use the TCHAR versions of the library functions, which convert to UNICODE or Ansi based on the project settings.
这篇关于如何在C ++中使用Unicode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文