Special characters on the console

I have finished my poker game, but now I want it to look a little better with Spades, Hearts, Diamonds and Clubs. I tried this answer: C ++: ASCII printing of hearts and diamonds with an independent platform

Maybe stupid, but I try:

cout << 'U+2662' << endl;

I don’t know how to write it down.

+3
source share
3 answers

UTF-8, . fileinfo.com - UTF-8, 0xE2 0x99 0xA5, "\xE2\x99\xA5" .

, UTF-8, .

+2

ASCII Windows, :

cout << (char) 3 << (char) 4 << (char) 5 << (char) 6 << endl;
//hearts, diamonds, clubs, spades

, , . .

0

std::wcout UTF-16 ( Mark), , Windows ( Vista?), Windows . wcout Visual Studio , , Cygwin, , MinGW . : L"string".

. , , UTF-8 , : ASCII UTF-16 ( wcout) Windows.

0
source

Source: https://habr.com/ru/post/1740803/


All Articles