Closed HertzDevil closed 2 years ago
good catch!
It should actually be setlocale(LC_ALL, "");
. The empty string makes it use the system's default locale. (especially on Windows that is not UTF-8)
fixed by 177bc44a8aa765d9d4e6246edbb453158395ff02 (enable UTF-8 on Unix) and b2554d5513ac74534e84ce2a559afb6f5a42cc21 (fix segfault)
Segmentation fault occurs with a command line such as
vgm_tag -AuthorJ:山根ミチル test.vgm
. It happens because the default locale isC
andmbtowc
doesn't recognize UTF-8:https://github.com/vgmrips/vgmtools/blob/1f8a5ebcf5e2f998123dfdcc7571c44020ed3ea5/vgm_tag.c#L544-L545
Here
mbtowc
returns -1 on the default locale. A workaround is to addsetlocale(LC_ALL, "en_US.utf8");
near the beginning of themain
function.