Reputation: 2456
I have enabled wide-string support in my C++ console application using:
_setmode(_fileno(stdin), _O_WTEXT);
_setmode(_fileno(stdout), _O_WTEXT);
I can read and output unicode characters just fine now using wprintf
(or std::wcin
), but because of this, plain printf
(and std::cin
) calls won't work as they throw exceptions. Is there any way to bypass/correct this? Replacing them does not sound like a solution.
Upvotes: 1
Views: 150
Reputation: 1001
Use wprintf
to output wide characters.
printf
does not allow to write to a wide/unicode stream:
https://msdn.microsoft.com/es-es/library/wc7014hz.aspx
Upvotes: 2