summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/FileUtil.cpp
diff options
context:
space:
mode:
authorRachel Bryk <RachelBryk@gmail.com>2013-10-09 15:33:21 -0400
committerRachel Bryk <RachelBryk@gmail.com>2013-10-09 15:33:21 -0400
commit99c89ae10961f84192cdbfc501b4ff45a559dcd1 (patch)
tree780e2ddb2ca992958866369ea4f005d8d9b03b82 /Source/Core/Common/Src/FileUtil.cpp
parentd5e40bfb01759d544102e7c02569a70312b16af0 (diff)
Fix unicode support for File::Rename() on windows.
Partial fix of issue 6721.
Diffstat (limited to 'Source/Core/Common/Src/FileUtil.cpp')
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp
index 7663e11078..dc07ddd7d7 100644
--- a/Source/Core/Common/Src/FileUtil.cpp
+++ b/Source/Core/Common/Src/FileUtil.cpp
@@ -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());