I am working on a desktop console application that requires the use of non-English characters (Hebrew).
Do you want to print Hebrew characters in the console? Please check this question on stackoverflow, and also this related topic.
Here is sample works for me:
#include <windows.h>
#include <iostream>
#include <fcntl.h> // for _setmode
#include <io.h>
int main() {
_setmode(_fileno(stdout), _O_U16TEXT);
std::wstring hebrewString = L"עברית";
std::reverse(hebrewString.begin(), hebrewString.end());
CONSOLE_FONT_INFOEX info = { 0 };
info.cbSize = sizeof(info);
info.dwFontSize.Y = 20;
wcscpy_s(info.FaceName, L"Courier New");
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), NULL, &info);
std::wcout<<hebrewString;
return 0;
}
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.