Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
Radoslav Dimitrov 12-May-13 4:42am    
I'm using Windows.
Volynsky Alex 12-May-13 6:28am    
It rather depends what you want to do with the text you are processing. Half the point of UTF-8 is that you don't need to change existing code if it handles 8-bit chars and does nothing special with characters above 128. Of course, strlen is the length in bytes rather than the character or code-point count.

To quote the Unicode Standard, version 5.2, chapter 5:
http://www.unicode.org/versions/Unicode5.2.0/ch05.pdf

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 the L prefix on your Unicode string constants like:
C++
wstring myString = L"Hello, World! \u2639";
 
Share this answer
 
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900