mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 21:30:19 -06:00
Fixed Issue 2005
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4820 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user