mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-06 12:40:24 +00:00
More wxString conversion cleanup.
This commit is contained in:
parent
aeb4fc9846
commit
fad2b65d76
@ -966,8 +966,7 @@ void CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event))
|
|||||||
if (!iso)
|
if (!iso)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxString strPath(iso->GetFileName().c_str(), wxConvUTF8);
|
wxFileName path = wxFileName::FileName(StrToWxStr(iso->GetFileName()));
|
||||||
wxFileName path = wxFileName::FileName(strPath);
|
|
||||||
path.MakeAbsolute();
|
path.MakeAbsolute();
|
||||||
WxUtils::Explore(path.GetPath().char_str());
|
WxUtils::Explore(path.GetPath().char_str());
|
||||||
}
|
}
|
||||||
|
@ -704,26 +704,11 @@ bool CMemcardManager::ReloadMemcard(const char *fileName, int card)
|
|||||||
std::string title = memoryCard[card]->GetSaveComment1(fileIndex);
|
std::string title = memoryCard[card]->GetSaveComment1(fileIndex);
|
||||||
std::string comment = memoryCard[card]->GetSaveComment2(fileIndex);
|
std::string comment = memoryCard[card]->GetSaveComment2(fileIndex);
|
||||||
|
|
||||||
bool ascii = memoryCard[card]->IsAsciiEncoding();
|
auto const string_decoder = memoryCard[card]->IsAsciiEncoding() ?
|
||||||
|
CP1252ToUTF8 : SHIFTJISToUTF8;
|
||||||
|
|
||||||
#ifdef _WIN32
|
wxTitle = StrToWxStr(string_decoder(title));
|
||||||
wxCSConv SJISConv(*(wxCSConv*)wxConvCurrent);
|
wxComment = StrToWxStr(string_decoder(comment));
|
||||||
static bool validCP932 = ::IsValidCodePage(932) != 0;
|
|
||||||
if (validCP932)
|
|
||||||
{
|
|
||||||
SJISConv = wxCSConv(wxFontMapper::GetEncodingName(wxFONTENCODING_SHIFT_JIS));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
WARN_LOG(COMMON, "Cannot Convert from Charset Windows Japanese cp 932");
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
// on linux the wrong string is returned from wxFontMapper::GetEncodingName(wxFONTENCODING_SHIFT_JIS)
|
|
||||||
// it returns CP-932, in order to use iconv we need to use CP932
|
|
||||||
wxCSConv SJISConv(wxT("CP932"));
|
|
||||||
#endif
|
|
||||||
wxTitle = wxString(title.c_str(), ascii ? *wxConvCurrent : SJISConv);
|
|
||||||
wxComment = wxString(comment.c_str(), ascii ? *wxConvCurrent : SJISConv);
|
|
||||||
|
|
||||||
m_MemcardList[card]->SetItem(index, COLUMN_TITLE, wxTitle);
|
m_MemcardList[card]->SetItem(index, COLUMN_TITLE, wxTitle);
|
||||||
m_MemcardList[card]->SetItem(index, COLUMN_COMMENT, wxComment);
|
m_MemcardList[card]->SetItem(index, COLUMN_COMMENT, wxComment);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user