mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 15:01:16 +01:00
Fix unicode support for File::Rename() on windows.
Partial fix of issue 6721.
This commit is contained in:
parent
d5e40bfb01
commit
99c89ae109
@ -241,7 +241,11 @@ bool Rename(const std::string &srcFilename, const std::string &destFilename)
|
|||||||
{
|
{
|
||||||
INFO_LOG(COMMON, "Rename: %s --> %s",
|
INFO_LOG(COMMON, "Rename: %s --> %s",
|
||||||
srcFilename.c_str(), destFilename.c_str());
|
srcFilename.c_str(), destFilename.c_str());
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (_trename(UTF8ToTStr(srcFilename).c_str(), UTF8ToTStr(destFilename).c_str()) == 0)
|
||||||
|
#else
|
||||||
if (rename(srcFilename.c_str(), destFilename.c_str()) == 0)
|
if (rename(srcFilename.c_str(), destFilename.c_str()) == 0)
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
ERROR_LOG(COMMON, "Rename: failed %s --> %s: %s",
|
ERROR_LOG(COMMON, "Rename: failed %s --> %s: %s",
|
||||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
|
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user