SDL: bugfix advancing UTF-8 length in UTF-16 string

From 8ddb074889af22601406e3e64173436580cbeea7 Mon Sep 17 00:00:00 2001
From: kyle-sylvestre <[EMAIL REDACTED]>
Date: Thu, 22 May 2025 14:36:38 -0400
Subject: [PATCH] bugfix advancing UTF-8 length in UTF-16 string

---
 src/dialog/windows/SDL_windowsdialog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/dialog/windows/SDL_windowsdialog.c b/src/dialog/windows/SDL_windowsdialog.c
index 6822944fc0829..d3cb8a27d1399 100644
--- a/src/dialog/windows/SDL_windowsdialog.c
+++ b/src/dialog/windows/SDL_windowsdialog.c
@@ -273,7 +273,7 @@ void windows_ShowFileDialog(void *ptr)
             SDL_strlcpy(chosen_file, chosen_folder, MAX_PATH);
             chosen_file[chosen_folder_size] = '\\';
 
-            file_ptr += SDL_strlen(chosen_folder) + 1;
+            file_ptr += SDL_wcslen(file_ptr) + 1;
 
             while (*file_ptr) {
                 nfiles++;
@@ -308,7 +308,7 @@ void windows_ShowFileDialog(void *ptr)
                     return;
                 }
 
-                file_ptr += SDL_strlen(chosen_file) + 1 - diff;
+                file_ptr += SDL_wcslen(file_ptr) + 1;
 
                 chosen_files_list[nfiles - 1] = SDL_strdup(chosen_file);