Extended Ascii not printing correctly

My code is this:
1
2
3
4
5
6
7
#include <iostream>

int main(void)
{
  std::cout << "É\n";
  return 0;
}


But the character printed out is not "É". What gives?

Edit: Well, this appears to be a console issue rather than C++. Is there a simple way to get this working? Probably not :)
Last edited on
Depends on your platform.

It's obviously not Linux, which supports Unicode as intended, and prints this correctly (see for example http://ideone.com/2chLsG )

If this is Windows, your best bet is to go wide (it's also a safe bet on Linux, and other systems): std::wcout << L"É\n";, except that on Visual Studio you'd have to issue the Microsoft-specific _setmode(_fileno(stdout), _O_WTEXT); (see MSDN for the necessary #include files).

Other compilers/platforms probably have their own ways.
Topic archived. No new replies allowed.