Last active
August 29, 2015 14:17
-
-
Save poizan42/3fba0804c76b97baae66 to your computer and use it in GitHub Desktop.
stub to call wmain from main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <codecvt> | |
#include <locale> | |
int main(int argc, const char *argv[]) | |
{ | |
std::wstring_convert < std::codecvt<wchar_t, char, std::mbstate_t> > conv; | |
std::vector<const wchar_t*> wargv; | |
std::vector<std::wstring> wsargv; | |
wargv.resize(argc); | |
wsargv.resize(argc); | |
for (int i = 0; i < argc; i++) | |
{ | |
wsargv[i] = conv.from_bytes(argv[i]); | |
wargv[i] = wsargv[i].c_str(); | |
} | |
return wmain(argc, wargv.data()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment