Skip to content

Commit

Permalink
Fix parsing parameters (#2493)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Dec 13, 2022
1 parent 1bed5b1 commit e66624a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions targets/win32/nanoCLR/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include <nanoCLR_Application.h>
#include <target_common.h>
#include <iostream>
#include <locale>
#include <codecvt>
#include <string>

//
// UNDONE: Feature configuration
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit e66624a

Please sign in to comment.