osutil: use system encoding on Windows
authorMunkyu Im <munkyu.im@samsung.com>
Wed, 15 Feb 2017 03:18:53 +0000 (12:18 +0900)
committerMunkyu Im <munkyu.im@samsung.com>
Wed, 15 Feb 2017 09:20:32 +0000 (18:20 +0900)
For unicode or other encodings,
set as system encoding when use CreateFile()

Change-Id: I99399e4bdfb871efbebbd9665d5b04c8d24c8c51
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
tizen/src/util/osutil-win32.c

index 48220da..6f4c65d 100644 (file)
@@ -90,7 +90,6 @@ void make_vm_lock_os(gchar *vms_path)
     g_assert(lock_filename == NULL);
 
     lock_filename = g_strdup_printf("%s\\%s", vms_path, VMLOCK_FILE);
-
     if (g_mkdir_with_parents(g_path_get_dirname(lock_filename), 0777)) {
         LOG_WARNING("Can not create directory for lock file: %ld\n",
                     GetLastError());
@@ -99,7 +98,7 @@ void make_vm_lock_os(gchar *vms_path)
         lock_filename = NULL;
         return;
     }
-    lock_file = CreateFile(lock_filename,
+    lock_file = CreateFile(g_win32_locale_filename_from_utf8(lock_filename),
             GENERIC_READ | GENERIC_WRITE,
             0,       // No share
             NULL,
@@ -207,7 +206,7 @@ bool make_sdcard_lock_os(char *sdcard)
     }
 
     fname = g_strdup_printf("%s.lck", sdcard);
-    h = CreateFile(fname,
+    h = CreateFile(g_win32_locale_filename_from_utf8(fname),
             GENERIC_READ,
             0,               // No share
             NULL,