libheif icon indicating copy to clipboard operation
libheif copied to clipboard

file-name character encoding in command line tools on Windows

Open farindk opened this issue 1 year ago • 1 comments

Filenames with diacritics characters or other non-English glyphs are not processed correctly on Windows because of the different character encoding used.

farindk avatar Oct 30 '24 20:10 farindk

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...

kmilos avatar Oct 31 '24 08:10 kmilos