0

On Windows, compiling and running this:

#include <iostream>
int main( ) {
    std::wcout << L"\u25a0" << std::endl;
    std::wcout << L"Hello world!" << std::endl << L"Hello world!" << std::endl;
    }

produces no output. Why? (I've tried on different computers, and with different fonts)

Edit: \u25a0 is the code for ■; uploaded screenshot.

Alexander Riccio
  • 358
  • 2
  • 12
  • 4
    The default `codecvt` facet used by `wcout` takes a Unicode character and attempts to convert it to system default codepage aka `CP_ACP`. Apparently, `U+25A0` is not representable in the system codepage configured on your machine. So the conversion fails, `failbit` is set, at which point all further operations on this stream fail immediately (until `failbit` is cleared). See also: http://stackoverflow.com/questions/19193429 – Igor Tandetnik Jul 05 '14 at 03:47
  • Ahh ok. (Is this the best possible design?) – Alexander Riccio Jul 08 '14 at 01:25

0 Answers0