diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2020-04-11 00:07:15 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2020-04-11 00:07:15 +0300 |
commit | a8d139ca20024fb3b63152989968ba2fd7434eae (patch) | |
tree | af5d8a3c1b38747141e4430cc39edc117171e7ae /source/blender/blenlib/intern/storage.c | |
parent | 4f9a56cbc4e8719ee421a57fd6695bed633c591b (diff) |
Fix for T75595: File Browser and Windows Unicode Paths
Fix for incorrect conversion to utf16 in BLI_file_attributes().
Differential Revision: https://developer.blender.org/D7398
Reviewed by Brecht Van Lommel
Diffstat (limited to 'source/blender/blenlib/intern/storage.c')
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 9b437b02c0a..154fc966ca2 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -232,8 +232,9 @@ eFileAttributes BLI_file_attributes(const char *path) int ret = 0; # ifdef WIN32 - wchar_t wline[FILE_MAXDIR]; - BLI_strncpy_wchar_from_utf8(wline, path, ARRAY_SIZE(wline)); + WCHAR wline[FILE_MAXDIR]; + size_t bsize = count_utf_16_from_8(path); + conv_utf_8_to_16(path, wline, bsize); DWORD attr = GetFileAttributesW(wline); if (attr & FILE_ATTRIBUTE_READONLY) { ret |= FILE_ATTR_READONLY; |