I am a beginner programmer and I'm working on a simple game. I want to output Unicode symbols like Alt+219 █ to the console. I am using CodeBlocks on Windows 10 and I am using GNU GCC compiler. Here is what I'm trying to do:
#include <iostream>
using namespace std;
int main()
{
cout << "\u2588";
return 0;
}
What I get on console is a few strange symbols. This happens even with other Unicode characters, but the symbols are different.
I tried using wcout
, but then i get just a blank space instead.
I also tried things like this:
_setmode(_fileno(stdout), _O_U16TEXT);
But then I get errors that _fileno
and _O_U16TEXT
was not declared, though I imported the libraries that seem to be necessary for this:
#include <iostream>
#include <io.h>
#include <fcntl.h>
#include <fstream>
The Unicode symbols are not totally necessary for my game, but I just want it look nicer.