pcsx2: Pass UTF-8 pathnames to plugins

Fixes empty log and ini directory paths being passed to the plugins on
Windows when the pathnames contain characters not present in the current
system codepage.

Fixes the inability to create snapshots when the pathname contains
non-ASCII characters on Linux (Windows requires more pathname handling
fixes).
This commit is contained in:
Jonathan Li 2018-07-14 00:51:56 +01:00
parent d09737dbb5
commit b2ae86d142
3 changed files with 4 additions and 8 deletions

View File

@ -1732,10 +1732,8 @@ void SysCorePlugins::SendSettingsFolder()
ScopedLock lock( m_mtx_PluginStatus ); ScopedLock lock( m_mtx_PluginStatus );
if( m_SettingsFolder.IsEmpty() ) return; if( m_SettingsFolder.IsEmpty() ) return;
wxCharBuffer buffer(m_SettingsFolder.mb_str(wxConvFile));
const PluginInfo* pi = tbl_PluginInfo; do { const PluginInfo* pi = tbl_PluginInfo; do {
if( m_info[pi->id] ) m_info[pi->id]->CommonBindings.SetSettingsDir( buffer ); if( m_info[pi->id] ) m_info[pi->id]->CommonBindings.SetSettingsDir( m_SettingsFolder.utf8_str() );
} while( ++pi, pi->shortname != NULL ); } while( ++pi, pi->shortname != NULL );
} }
@ -1758,10 +1756,8 @@ void SysCorePlugins::SendLogFolder()
ScopedLock lock( m_mtx_PluginStatus ); ScopedLock lock( m_mtx_PluginStatus );
if( m_LogFolder.IsEmpty() ) return; if( m_LogFolder.IsEmpty() ) return;
wxCharBuffer buffer(m_LogFolder.mb_str(wxConvFile));
const PluginInfo* pi = tbl_PluginInfo; do { const PluginInfo* pi = tbl_PluginInfo; do {
if( m_info[pi->id] ) m_info[pi->id]->CommonBindings.SetLogDir( buffer ); if( m_info[pi->id] ) m_info[pi->id]->CommonBindings.SetLogDir( m_LogFolder.utf8_str() );
} while( ++pi, pi->shortname != NULL ); } while( ++pi, pi->shortname != NULL );
} }

View File

@ -353,7 +353,7 @@ namespace Implementations
void Sys_TakeSnapshot() void Sys_TakeSnapshot()
{ {
GSmakeSnapshot( g_Conf->Folders.Snapshots.ToAscii() ); GSmakeSnapshot( g_Conf->Folders.Snapshots.ToUTF8() );
} }
void Sys_RenderToggle() void Sys_RenderToggle()

View File

@ -130,7 +130,7 @@ static void OnSlotChanged()
OSDlog( Color_StrongGreen, true, " > Selected savestate slot %d", StatesC ); OSDlog( Color_StrongGreen, true, " > Selected savestate slot %d", StatesC );
if( GSchangeSaveState != NULL ) if( GSchangeSaveState != NULL )
GSchangeSaveState(StatesC, SaveStateBase::GetFilename(StatesC).mb_str()); GSchangeSaveState(StatesC, SaveStateBase::GetFilename(StatesC).utf8_str());
Sstates_updateLoadBackupMenuItem(); Sstates_updateLoadBackupMenuItem();
} }