Skip to content

Commit 14e5aa5

Browse files
committed
wx: UTF8 path fix
1 parent cdc49d1 commit 14e5aa5

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

rpcs3/Gui/GameViewer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void GameViewer::RemoveGame(wxCommandEvent& event)
235235

236236
if (wxMessageBox("Permanently delete game files?", "Confirm Delete", wxYES_NO | wxNO_DEFAULT) == wxYES)
237237
{
238-
fs::remove_all(Emu.GetGameDir() + this->GetItemText(i, 6).ToStdString());
238+
fs::remove_all(Emu.GetGameDir() + fmt::ToUTF8(this->GetItemText(i, 6)));
239239
}
240240

241241
Refresh();

rpcs3/Gui/MainFrame.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,25 +210,27 @@ void MainFrame::BootGame(wxCommandEvent& WXUNUSED(event))
210210
{
211211
bool stopped = false;
212212

213-
if(Emu.IsRunning())
213+
if (Emu.IsRunning())
214214
{
215215
Emu.Pause();
216216
stopped = true;
217217
}
218218

219219
wxDirDialog ctrl(this, L"Select game folder", wxEmptyString);
220220

221-
if(ctrl.ShowModal() == wxID_CANCEL)
221+
if (ctrl.ShowModal() == wxID_CANCEL)
222222
{
223-
if(stopped) Emu.Resume();
223+
if (stopped) Emu.Resume();
224224
return;
225225
}
226226

227227
Emu.Stop();
228+
229+
const std::string path = fmt::ToUTF8(ctrl.GetPath());
228230

229-
if(!Emu.BootGame(ctrl.GetPath().ToStdString()))
231+
if (!Emu.BootGame(path))
230232
{
231-
LOG_ERROR(GENERAL, "PS3 executable not found in selected folder (%s)", fmt::ToUTF8(ctrl.GetPath())); // passing std::string (test)
233+
LOG_ERROR(GENERAL, "PS3 executable not found in selected folder (%s)", path);
232234
}
233235
}
234236

@@ -243,12 +245,14 @@ void MainFrame::InstallPkg(wxCommandEvent& WXUNUSED(event))
243245

244246
Emu.Stop();
245247

248+
const std::string path = fmt::ToUTF8(ctrl.GetPath());
249+
246250
// Open PKG file
247-
fs::file pkg_f(ctrl.GetPath().ToStdString());
251+
fs::file pkg_f(path);
248252

249253
if (!pkg_f || pkg_f.size() < 64)
250254
{
251-
LOG_ERROR(LOADER, "PKG: Failed to open %s", ctrl.GetPath().ToStdString());
255+
LOG_ERROR(LOADER, "PKG: Failed to open %s", path);
252256
return;
253257
}
254258

@@ -428,7 +432,9 @@ void MainFrame::InstallFirmware(wxCommandEvent& WXUNUSED(event))
428432

429433
Emu.Stop();
430434

431-
fs::file pup_f(ctrl.GetPath().ToStdString());
435+
const std::string path = fmt::ToUTF8(ctrl.GetPath());
436+
437+
fs::file pup_f(path);
432438
pup_object pup(pup_f);
433439
if (!pup)
434440
{

0 commit comments

Comments
 (0)