Fix parsing parameters
#include <nanoCLR_Application.h>
#include <target_common.h>
#include <iostream>
+#include <locale>
+#include <codecvt>
+#include <string>
//
// UNDONE: Feature configuration
@@ -68,7 +71,7 @@ bool Target_GetReleaseInfo(NFReleaseInfo &releaseInfo)
/////////////////////////////////////////////////////////////////////////////
//
-int _tmain(int argc, wchar_t *argv[])
+int _tmain(int argc, _TCHAR *argv[])
{
wprintf(L"\n.NET nanoFramework nanoCLR WIN32 v");
std::cout << VERSION_STRING;
@@ -87,10 +90,11 @@ int _tmain(int argc, wchar_t *argv[])
// fill arguments from command line
clrSettings.StartArgs.resize(argc - 1);
+ std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
+
for (int i = 0; i < argc - 1; i++)
{
- std::wstring argv_ = std::wstring(argv[1 + i]);
- clrSettings.StartArgs[i] = argv_;
+ clrSettings.StartArgs[i] = converter.from_bytes(argv[1 + i]);
}
ClrStartup(clrSettings);
