MediaInfo_Open doesn't open files with specific characters like 'ü' in filename
The library function MediaInfo_Open fails to open files that have specific characters like 'ü' in the filename, see sample program and files attached.
mediainfo and mediainfo-gui work with these files no problem.
This happens under Linux with MediaInfoLib version 25.09, with the 'ü' character stored as UTF-8 0xC3 0xBC.
mediainfo_ue.c
ü.png (save as ü.png, this one doesn't work)
u.png (save as u.png, this one does work)
Try
MediaInfo_Option(mi, "CharSet", "UTF-8");
MediaInfo_Option(mi, "setlocale_LC_CTYPE", "");
You didn't indicate to the OS that you expect UTF-8 (or any OS config) input, by default it is not UTF-8.
setlocale(LC_ALL, ""); for using OS settings.
Or @cjee21 suggestion (it forces MediaInfoLib to consider the input as UTF-8, but it would fail if the OS sends an argument in another locale, rare nowadays).
Thank you, the setlocale(LC_ALL, "") seems to work.
But still strikes me as odd how a lib can't open filenames that libc functions have no problem with.
Read through https://github.com/MediaArea/MediaInfo/issues/134 that it's more of a platform interoperability issue.
But still strikes me as odd how a lib can't open filenames that libc functions have no problem with.
I would have expected that it is same with the libc without this init, I need to check again the related code there at some point.