diff options
author | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2011-12-30 22:44:49 +0000 |
---|---|---|
committer | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2011-12-30 22:44:49 +0000 |
commit | 1604324e625b11dcf0802fdb68863ccc6c24742d (patch) | |
tree | 5feadcb1dc083dc1dd166f31c101242db6c0567b /src/util/os_installation.c | |
parent | 3809a554279d1685b1c12163098355a3a55d664d (diff) |
-LRN: utf8-ization, #2051
git-svn-id: https://gnunet.org/svn/gnunet@18857 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/util/os_installation.c')
-rw-r--r-- | src/util/os_installation.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/util/os_installation.c b/src/util/os_installation.c index 6d25c57096..c0b7c85836 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c @@ -112,15 +112,19 @@ get_path_from_proc_exe () static char * get_path_from_module_filename () { - char path[4097]; - char *idx; + wchar_t path[4097]; + char upath[4097]; + wchar_t *idx; - GetModuleFileName (NULL, path, sizeof (path) - 1); - idx = path + strlen (path); - while ((idx > path) && (*idx != '\\') && (*idx != '/')) + GetModuleFileNameW (NULL, path, sizeof (path) - 1); + idx = path + wcslen (path); + while ((idx > path) && (*idx != L'\\') && (*idx != L'/')) idx--; - *idx = '\0'; - return GNUNET_strdup (path); + *idx = L'\0'; + upath[0] = '\0'; + WideCharToMultiByte (CP_UTF8, 0, path, -1, upath, 4097, NULL, NULL); + + return GNUNET_strdup (upath); } #endif |