file-name character encoding in command line tools on Windows
Filenames with diacritics characters or other non-English glyphs are not processed correctly on Windows because of the different character encoding used.
If you're ok w/ making this work only on Windows 10 1903 and newer, the fix is to make libheif clients run in UTF-8 locale, so code is finally simplified and identical on all platforms.
See e.g. https://github.com/libjxl/libjxl/commit/7b70ef19383a73d8a44bd9bbe15df140412df300
Note that any existing -W API and wstring/wchar_t conversion can then be removed (incl. building w/ UNICODE macro and/or -municode switch for MinGW; it seems these were missing anyway).
Otherwise you'll also need the wmain() wrapper and handle wstring/wchar_t conversion of input arguments manually and/or use -W API appropriately...