0

Want to type symbol(â) in unicode in Visual Studio C++ program. Try this:

cout << "Let \u00E2";

but puts out some kind of cyrillic letter (probably because Windows OS is Russian?) Code page Visual C++ using seems to be 65001 (which is UTF-8), but not sure how can I check this.

Alex.S
  • 33
  • 7
  • 1
    You should use L prefix for Unicode string literals – Asesh Sep 23 '17 at 11:19
  • If you want to output `UTF-8` then you need to convert `"â"` to `UTF-8` which is `"\xC3\xA2"` according to http://www.i18nqa.com/debug/utf8-debug.html – Galik Sep 23 '17 at 11:33
  • @Asesh L prefix only for wchar_t and wcout no? – Alex.S Sep 23 '17 at 11:34
  • 2
    `cout` uses ANSI codepage by default. Use `_setmode(_fileno(stdout), _O_U16TEXT); wcout << L"Let \u00E2";`. Make sure you have font for console that can display the character. Also see linked question. – zett42 Sep 23 '17 at 14:50

0 Answers0