Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing UTF8 conversion #1390

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading