0

I'm trying to print the Airplane symbol using Unicode in my CodeBlocks. I found out that the code of Airplane is \u2708. So I tried the following code:

   #include <iostream>

using namespace std;

int main() {
    wchar_t a = '\u2708';
    cout << a;
return 0;
}

It outputs 40072 when I replace wchar_t with char

char a = '\u2708';

I get this symbol: ł

Im really stuck, thanks for any help.

Ajith Renjala
  • 4,934
  • 5
  • 34
  • 42
Filip Mik
  • 3
  • 2
  • 1
    possible duplicate of [How to print unicode character in C++?](http://stackoverflow.com/questions/12015571/how-to-print-unicode-character-in-c) – Captain Giraffe Oct 18 '14 at 10:55

1 Answers1

1

If you are in Linux and dont use codepage conversion from unicode to console try this:

std::locale::global(std::locale(""));
wchar_t plane = L'\u2708';
std::wcout << plane << std::endl;

In windows is a bit more complicated, you need a compatible unicode font on the default console and the correct codepage.

Tek
  • 46
  • 1
  • 4