WX: Fix argument parsing

Manually convert each argument to a UTF-8 std::string, because the
implicit conversion for wxCmdLineArgsArray to char** calls ToAscii
(which is obviously undesired).

Fixes https://bugs.dolphin-emu.org/issues/10274
This commit is contained in:
Léo Lam
2017-11-26 17:22:37 +01:00
parent 96e094e127
commit 60afb1d1b4
3 changed files with 28 additions and 5 deletions

View File

@ -165,7 +165,14 @@ bool DolphinApp::OnInit()
void DolphinApp::ParseCommandLine()
{
auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::IncludeGUIOptions);
optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv);
// Manually convert each argument to a UTF-8 std::string, because the implicit
// conversion of wxCmdLineArgsArray to char** calls ToAscii (which is undesired).
std::vector<std::string> utf8_argv;
for (int i = 1; i < argc; ++i)
utf8_argv.emplace_back(argv[i].utf8_str());
optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), utf8_argv);
std::vector<std::string> args = parser->args();
if (options.is_set("exec"))