The following code:
#include <iostream> using std::wcin; using std::wcout; using std::locale; int main() { locale::global(locale("Portuguese_Brazil")); wcout << "wcin Test using \"ção\": "; // shows that wcout works properly wchar_t wcinTest[] = L""; wcin >> wcinTest; wcout << wcinTest << " should be \"ção\"."; return 0; } Results in:
wcin Test using "ção": ção ╬Æo should be "ção". The ╬ character is U+2021 or 8225, and the ç is U+00E7 or 231.
I changed mult-bytes option, set and not set UNICODE in project properties. Nothing worked.
I already set the console font into Consolas, a true type font capable of displaying the ç character correctly.
I'd like this as simple and reproducible possible to use as a standard practice for future UNICODE console applications.
Any ideas?