Explorar el Código

Fix drop path encoding on windows

luboslenco hace 7 meses
padre
commit
5ae2d7caa4
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      armorcore/sources/iron.h

+ 7 - 1
armorcore/sources/iron.h

@@ -710,8 +710,14 @@ void _drop_files(wchar_t *file_path, void *data) {
 	_mouse_move(0, p.x, p.y, 0, 0, NULL);
 #endif
 
-	char buffer[512];
+	char buffer[1024];
+
+#ifdef KINC_WINDOWS
+	WideCharToMultiByte(CP_UTF8, 0, file_path, wcslen(file_path), buffer, sizeof(buffer), NULL, NULL);
+#else
 	wcstombs(buffer, file_path, sizeof(buffer));
+#endif
+
 	iron_drop_files(buffer);
 	in_background = false;