Skip to content

Commit e66624a

Browse files
authored
Fix parsing parameters (#2493)
1 parent 1bed5b1 commit e66624a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

targets/win32/nanoCLR/main.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#include <nanoCLR_Application.h>
99
#include <target_common.h>
1010
#include <iostream>
11+
#include <locale>
12+
#include <codecvt>
13+
#include <string>
1114

1215
//
1316
// UNDONE: Feature configuration
@@ -68,7 +71,7 @@ bool Target_GetReleaseInfo(NFReleaseInfo &releaseInfo)
6871
/////////////////////////////////////////////////////////////////////////////
6972
//
7073

71-
int _tmain(int argc, wchar_t *argv[])
74+
int _tmain(int argc, _TCHAR *argv[])
7275
{
7376
wprintf(L"\n.NET nanoFramework nanoCLR WIN32 v");
7477
std::cout << VERSION_STRING;
@@ -87,10 +90,11 @@ int _tmain(int argc, wchar_t *argv[])
8790
// fill arguments from command line
8891
clrSettings.StartArgs.resize(argc - 1);
8992

93+
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
94+
9095
for (int i = 0; i < argc - 1; i++)
9196
{
92-
std::wstring argv_ = std::wstring(argv[1 + i]);
93-
clrSettings.StartArgs[i] = argv_;
97+
clrSettings.StartArgs[i] = converter.from_bytes(argv[1 + i]);
9498
}
9599

96100
ClrStartup(clrSettings);

0 commit comments

Comments
 (0)