Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::string narrow(const std::wstring &s)
- {
- size_t len = WideCharToMultiByte(CP_UTF8, 0, s.c_str(), -1, nullptr, 0, nullptr, nullptr);
- char* buf = new char[len];
- WideCharToMultiByte(CP_UTF8, 0, s.c_str(), -1, buf, len, nullptr, nullptr);
- std::string ret(buf);
- delete[] buf;
- return ret;
- }
- inline std::ostream& operator<<(std::ostream& out, const std::wstring& str)
- {
- out << unicode::narrow(str);
- return out;
- }
- int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
- {
- g2LogWorker w("test", "..\\log\\");
- g2::initializeLogging(&w);
- LOG(INFO) << "風林火山";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement