Reputation: 6301
I want to print ▌ symbol to console. I tried
printf(L"▌");
and
wchar_t t = L'\u2588';
wprintf(L"%c\n", t);
But i get only '?' in result. I use Visual Studio 2012
Update
if I set the locale to en-US
setlocale(LC_ALL, "en-US");
I get |
for █
, +
for ╫
and _
for ▄
Upvotes: 1
Views: 1242
Reputation: 6301
To enable unicode in console we should use _setmode(_fileno(stdout), _O_U16TEXT);
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
void main()
{
_setmode(_fileno(stdout), _O_U16TEXT);
wprintf(L"█");
}
Upvotes: 1