I want to display an Arabic message mixed with Chinese using wcout.
The following code is in order:
#include <iostream> using namespace std; int main() { wcout.imbue(locale("chs")); wcout << L"中文"; // OK }
However, the following code does not work:
#include <iostream> using namespace std; int main() { wcout.imbue(locale(/* What to place here ??? */)); wcout << L"أَبْجَدِيَّة عَرَبِيَّة中文"; // Output nothing. VC++ 2012 on Win7 x64 // Why does the main advantage of unicode not apply here? }
I think the concept of code pages should be obsolete after accepting unicode.
Q1. What wout mechanism displays such text?
Q2. Why doesn't Windows, like Unicode-based OS, support Unicode output in the console window?
c ++ io windows-7 unicode
xmllmx
source share