QTfrontend/main.cpp
changeset 14893 18bfa0a3c117
parent 14877 cd0af25c7913
child 14908 a414d37278df
--- a/QTfrontend/main.cpp	Wed May 01 21:59:41 2019 +0300
+++ b/QTfrontend/main.cpp	Wed May 01 23:11:22 2019 +0300
@@ -328,10 +328,10 @@
         checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars");
         cfgdir->cd("Library/Application Support/Hedgewars");
 #elif defined _WIN32
-        char path[1024];
-        if(!SHGetFolderPathA(0, CSIDL_PERSONAL, NULL, 0, path))
+        wchar_t path[MAX_PATH];
+        if(SHGetFolderPathW(0, CSIDL_PERSONAL, NULL, 0, path) == S_OK)
         {
-            cfgdir->cd(path);
+            cfgdir->cd(QString::fromWCharArray(path));
             checkForDir(cfgdir->absolutePath() + "/Hedgewars");
             cfgdir->cd("Hedgewars");
         }