diff --git a/Source/Core/DolphinWX/Src/MemcardManager.cpp b/Source/Core/DolphinWX/Src/MemcardManager.cpp index 61058cdf06..7a2a31416d 100644 --- a/Source/Core/DolphinWX/Src/MemcardManager.cpp +++ b/Source/Core/DolphinWX/Src/MemcardManager.cpp @@ -655,7 +655,6 @@ bool CMemcardManager::ReloadMemcard(const char *fileName, int card) if (memoryCard[card]->fail) return false; int j; - bool ascii = memoryCard[card]->IsAsciiEncoding(); wxString wxTitle, wxComment, @@ -758,16 +757,10 @@ bool CMemcardManager::ReloadMemcard(const char *fileName, int card) if (!memoryCard[card]->DEntry_Comment1(j, title)) title[0]=0; if (!memoryCard[card]->DEntry_Comment2(j, comment)) comment[0]=0; - if (ascii) - { - wxTitle = wxString::FromAscii(title); - wxComment = wxString::FromAscii(comment); - } - else - { - WxUtils::CopySJISToString(wxTitle, title); - WxUtils::CopySJISToString(wxComment, comment); - } + wxCSConv SJISConv(wxT("SHIFT_JIS")); + wxTitle = wxString(title, SJISConv); + wxComment = wxString(comment, SJISConv); + m_MemcardList[card]->SetItem(index, COLUMN_TITLE, wxTitle); m_MemcardList[card]->SetItem(index, COLUMN_COMMENT, wxComment); diff --git a/Source/Core/DolphinWX/Src/WxUtils.cpp b/Source/Core/DolphinWX/Src/WxUtils.cpp index 058ba5d049..04e0d1453b 100644 --- a/Source/Core/DolphinWX/Src/WxUtils.cpp +++ b/Source/Core/DolphinWX/Src/WxUtils.cpp @@ -25,7 +25,8 @@ namespace WxUtils { // Launch a file according to its mime type void Launch(const char *filename) { - if (! ::wxLaunchDefaultBrowser(wxString::FromAscii(filename))) { + if (! ::wxLaunchDefaultBrowser(wxString(filename, *wxConvCurrent))) + { // WARN_LOG } } @@ -33,70 +34,17 @@ void Launch(const char *filename) // Launch an file explorer window on a certain path void Explore(const char *path) { - wxString wxPath = wxString::FromAscii(path); - + wxString wxPath = wxString(path, *wxConvCurrent); // Default to file - if (! wxPath.Contains(wxT("://"))) { + if (! wxPath.Contains(wxT("://"))) + { wxPath = wxT("file://") + wxPath; } - if (! ::wxLaunchDefaultBrowser(wxPath)) { + if (! ::wxLaunchDefaultBrowser(wxPath)) + { // WARN_LOG } } -bool CopySJISToString(wxString& _rDestination, const char* _src) -{ - bool returnCode = false; -#ifdef WIN32 - // HyperIris: because dolphin using "Use Multi-Byte Character Set", - // we must convert the SJIS chars to unicode then to our windows local by hand - u32 unicodeNameSize = MultiByteToWideChar(932, MB_PRECOMPOSED, - _src, (int)strlen(_src), NULL, NULL); - if (unicodeNameSize > 0) - { - u16* pUnicodeStrBuffer = new u16[unicodeNameSize + 1]; - if (pUnicodeStrBuffer) - { - memset(pUnicodeStrBuffer, 0, (unicodeNameSize + 1) * sizeof(u16)); - if (MultiByteToWideChar(932, MB_PRECOMPOSED, - _src, (int)strlen(_src), - (LPWSTR)pUnicodeStrBuffer, unicodeNameSize)) - { - -#ifdef _UNICODE - _rDestination = (LPWSTR)pUnicodeStrBuffer; - returnCode = true; -#else - u32 ansiNameSize = WideCharToMultiByte(CP_ACP, 0, - (LPCWSTR)pUnicodeStrBuffer, unicodeNameSize, - NULL, NULL, NULL, NULL); - if (ansiNameSize > 0) - { - char* pAnsiStrBuffer = new char[ansiNameSize + 1]; - if (pAnsiStrBuffer) - { - memset(pAnsiStrBuffer, 0, (ansiNameSize + 1) * sizeof(char)); - if (WideCharToMultiByte(CP_ACP, 0, - (LPCWSTR)pUnicodeStrBuffer, unicodeNameSize, - pAnsiStrBuffer, ansiNameSize, NULL, NULL)) - { - _rDestination = pAnsiStrBuffer; - returnCode = true; - } - delete pAnsiStrBuffer; - } - } -#endif - } - delete pUnicodeStrBuffer; - } - } -#else - _rDestination = wxString(_src,wxConvUTF8); - returnCode = true; -#endif - return returnCode; -} - } // namespace diff --git a/Source/Core/DolphinWX/Src/WxUtils.h b/Source/Core/DolphinWX/Src/WxUtils.h index f665df81d5..8e837e9e96 100644 --- a/Source/Core/DolphinWX/Src/WxUtils.h +++ b/Source/Core/DolphinWX/Src/WxUtils.h @@ -26,7 +26,6 @@ void Launch(const char *filename); // Launch an file explorer window on a certain path void Explore(const char *path); -bool CopySJISToString(wxString& _rDestination, const char* _src); } // namespace #endif // WXUTILS