Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix unicode support for File::Rename() on windows.
Partial fix of issue 6721.
  • Loading branch information
RachelBryk committed Oct 9, 2013
1 parent d5e40bf commit 99c89ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Core/Common/Src/FileUtil.cpp
Expand Up @@ -241,7 +241,11 @@ bool Rename(const std::string &srcFilename, const std::string &destFilename)
{
INFO_LOG(COMMON, "Rename: %s --> %s",
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)
#endif
return true;
ERROR_LOG(COMMON, "Rename: failed %s --> %s: %s",
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
Expand Down

0 comments on commit 99c89ae

Please sign in to comment.