console encoding patch

This commit is contained in:
2022-04-26 22:49:31 +03:00
parent 5ae1cfae87
commit 2f4e73ef13
4 changed files with 47 additions and 7 deletions

View File

@@ -152,12 +152,15 @@ PIInit::PIInit() {
}
# endif //WINDOWS
# ifdef HAS_LOCALE
//cout << "has locale" << endl;
//std::cout << "has locale" << std::endl;
if (currentLocale_t != 0) {
freelocale(currentLocale_t);
currentLocale_t = 0;
}
currentLocale_t = newlocale(LC_ALL, setlocale(LC_ALL, ""), 0);
//std::ios_base::sync_with_stdio(false);
//std::locale utf8( std::locale(), new std::codecvt_utf8<wchar_t> );
//std::wcout.imbue(utf8);
# else //HAS_LOCALE
setlocale(LC_ALL, "");
setlocale(LC_NUMERIC, "C");
@@ -212,9 +215,6 @@ PIInit::PIInit() {
if (gethostname(cbuff, 1023) == 0) {
sinfo->hostname = cbuff;
}
// std::ios_base::sync_with_stdio(false);
// std::locale utf8( std::locale(), new std::codecvt_utf8<wchar_t> );
// std::wcout.imbue(utf8);
#ifdef WINDOWS
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);