Changeset View
Changeset View
Standalone View
Standalone View
src/util.cpp
Show First 20 Lines • Show All 1,129 Lines • ▼ Show 20 Lines | try { | ||||
setenv("LC_ALL", "C", 1); | setenv("LC_ALL", "C", 1); | ||||
} | } | ||||
#endif | #endif | ||||
// The path locale is lazy initialized and to avoid deinitialization errors | // The path locale is lazy initialized and to avoid deinitialization errors | ||||
// in multithreading environments, it is set explicitly by the main thread. | // in multithreading environments, it is set explicitly by the main thread. | ||||
// A dummy locale is used to extract the internal default locale, used by | // A dummy locale is used to extract the internal default locale, used by | ||||
// fs::path, which is then used to explicitly imbue the path. | // fs::path, which is then used to explicitly imbue the path. | ||||
std::locale loc = fs::path::imbue(std::locale::classic()); | std::locale loc = fs::path::imbue(std::locale::classic()); | ||||
#ifndef WIN32 | |||||
fs::path::imbue(loc); | fs::path::imbue(loc); | ||||
#else | |||||
fs::path::imbue(std::locale(loc, new std::codecvt_utf8_utf16<wchar_t>())); | |||||
#endif | |||||
} | } | ||||
bool SetupNetworking() { | bool SetupNetworking() { | ||||
#ifdef WIN32 | #ifdef WIN32 | ||||
// Initialize Windows Sockets. | // Initialize Windows Sockets. | ||||
WSADATA wsadata; | WSADATA wsadata; | ||||
int ret = WSAStartup(MAKEWORD(2, 2), &wsadata); | int ret = WSAStartup(MAKEWORD(2, 2), &wsadata); | ||||
if (ret != NO_ERROR || LOBYTE(wsadata.wVersion) != 2 || | if (ret != NO_ERROR || LOBYTE(wsadata.wVersion) != 2 || | ||||
Show All 20 Lines |