Skip to content

Commit

Permalink
Add missing UTF8 conversion (#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst authored Oct 12, 2024
1 parent 0487c51 commit 29fc0ab
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/fluidsynth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,18 @@ int main(int argc, char **argv)
/* create the player and add any midi files, if requested */
for(i = arg1; i < argc; i++)
{
if((argv[i][0] != '-') && fluid_is_midifile(argv[i]))
const char *u8_path = argv[i];
#if defined(_WIN32)
/* try to convert ANSI encoding path to UTF8 encoding path */
char *u8_buf = win32_ansi_to_utf8(argv[i]);
if (u8_buf == NULL)
{
// error msg. already printed
goto cleanup;
}
u8_path = u8_buf;
#endif
if((u8_path[0] != '-') && fluid_is_midifile(u8_path))
{
if(player == NULL)
{
Expand All @@ -1063,8 +1074,11 @@ int main(int argc, char **argv)
}
}

fluid_player_add(player, argv[i]);
fluid_player_add(player, u8_path);
}
#if defined(_WIN32)
free(u8_buf);
#endif
}

/* try to load and execute the user or system configuration file */
Expand Down

0 comments on commit 29fc0ab

Please sign in to comment.