diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-26 13:21:21 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-26 13:27:58 +0300 |
commit | 98e3694c39f3dde7a9d01b82ea627e55fa5eda8f (patch) | |
tree | cfb25cde9195d2d5dedd8657471c46f21cc02fa1 /source/blender/editors/space_file/fsmenu.c | |
parent | 88facb8876c3943685e0b69a5c2f01d77f136252 (diff) |
Fix T43817: issue with non-utf8 encodings in Windows paths, again...
We need to use 'W' widechar variants of win funcs and convert wchar to utf8-encoded bytes
in those cases, sigh...
Note: theoritical fix only, need org reporter to test it...
Diffstat (limited to 'source/blender/editors/space_file/fsmenu.c')
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 6b4ee318633..c6ee6875403 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -437,6 +437,7 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) #ifdef WIN32 /* Add the drive names to the listing */ { + wchar_t wline[FILE_MAXDIR]; __int64 tmp; char tmps[4]; int i; @@ -456,9 +457,11 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) /* Adding Desktop and My Documents */ if (read_bookmarks) { - SHGetSpecialFolderPath(0, line, CSIDL_PERSONAL, 0); + SHGetSpecialFolderPathW(0, wline, CSIDL_PERSONAL, 0); + BLI_strncpy_wchar_as_utf8(line, wline, FILE_MAXDIR); fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, line, NULL, FS_INSERT_SORTED); - SHGetSpecialFolderPath(0, line, CSIDL_DESKTOPDIRECTORY, 0); + SHGetSpecialFolderPathW(0, wline, CSIDL_DESKTOPDIRECTORY, 0); + BLI_strncpy_wchar_as_utf8(line, wline, FILE_MAXDIR); fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, line, NULL, FS_INSERT_SORTED); } } |