I want to output chess symbols from unicode to console in c++, please tell me how to do that.
Im using Dev c++, windows8 and console.
Im just a beginner so please keep it simple for me (also tell me the libraries to include please)
Im just a beginner so please keep it simple for me
The problem is that it's not simple. You can tell C++ to write Unicode characters until you're blue in the face, but if the console isn't set up to support Unicode or using a font that supports those characters, you won't get the correct output. It's more of a limitation of the command prompt than C++.
I'd suggest using Google, but this page is a good starting point as well. Note that cout/wcout correspond roughly to printf/wprintf.
I've been searching for days, and everyone keeps telling to change font to Lucida Console Unicode, use wide characters and output using wcout.
But the thing is:
1.How to change font to Lucida Console Unicode?
2.If i try to just copy/paste the character (like ♔) in Dev C++, there appears '?' instead of '♔'
3.There must be a function for UNICODE like char(x) is for ASCII
Yes i've read that page before. But as i said before, i'm just a beginner. So i did not get a word that was written there. I'm very much confused right now.. Can you send me a sample code for doing this task? including the libraries..
Shall I assume that your next complaint will be that you're seeing nothing but question marks or squares in the command prompt? Because that would take us full circle on your complete failure to comprehend all of the useful information you've been given.
u'9812' (C++11 only) or L'\x9812'. The former is preferred if supported. Some compilers also offer a unicode escape such as L'\u9812'. For multiple characters use the string variant L"<character codes go here>".