mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-14 10:21:21 +00:00
Windows: log command line args in utf8
This commit is contained in:
parent
e58bd419f6
commit
1eac13b6bf
@ -33,7 +33,7 @@
|
||||
#ifdef _WIN32
|
||||
#include "module_verifier.hpp"
|
||||
#include "util/dyn_lib.hpp"
|
||||
|
||||
#include <shellapi.h>
|
||||
|
||||
// TODO(cjj19970505@live.cn)
|
||||
// When compiling with WIN32_LEAN_AND_MEAN definition
|
||||
@ -620,11 +620,26 @@ int main(int argc, char** argv)
|
||||
std::string argument_str;
|
||||
for (int i = 0; i < argc; i++)
|
||||
{
|
||||
if (i > 0) argument_str += " ";
|
||||
argument_str += '\'' + std::string(argv[i]) + '\'';
|
||||
if (i != argc - 1) argument_str += " ";
|
||||
}
|
||||
|
||||
sys_log.notice("argc: %d, argv: %s", argc, argument_str);
|
||||
|
||||
#ifdef _WIN32
|
||||
int n_args = 0;
|
||||
if (LPWSTR* arg_list = CommandLineToArgvW(GetCommandLineW(), &n_args))
|
||||
{
|
||||
std::string utf8_args;
|
||||
for (int i = 0; i < n_args; i++)
|
||||
{
|
||||
if (i > 0) utf8_args += " ";
|
||||
utf8_args += '\'' + wchar_to_utf8(arg_list[i]) + '\'';
|
||||
}
|
||||
sys_log.notice("argv_utf8: %s", utf8_args);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Before we proceed, run some sanity checks
|
||||
run_platform_sanity_checks();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user