From 6b89496566bb8ef37a25f4ebbf5784feb68c99c7 Mon Sep 17 00:00:00 2001 From: Alex Taber Date: Wed, 24 Apr 2024 14:17:55 -0400 Subject: [PATCH] Properly handle Unicode file names on download Closes #303. May still need additional testing to ensure everything works properly, but preliminary testing passes. --- source/fs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/fs.c b/source/fs.c index 55fba5b..e2a89a7 100644 --- a/source/fs.c +++ b/source/fs.c @@ -407,7 +407,9 @@ renamed: strcat(path_to_file, ".zip"); DEBUG("path: %s\n", path_to_file); - FS_Path path = fsMakePath(PATH_ASCII, path_to_file); + u16 utf16path[0x106] = {0}; + utf8_to_utf16(utf16path, path_to_file, 0x106); + FS_Path path = fsMakePath(PATH_UTF16, utf16path); // check if file already exists, and if it does, prompt the user // to overwrite or change name (or exit)