On Thu, 17 Feb 2022, nil-admir...@mailo.com wrote:

if the path later is going to end up in a codepath that expects it to be UTF8 
(please do check!), then we should go that way instead

I checked. datadir ends up in (cmdutils.c:2104)

   base[2] = datadir;

and base[*] are later used in (cmdutils.c:2112 or 2116)

   snprintf(filename, filename_size, "%s%s/%s.ffpreset", base[i],
            i != 1 ? "" : "/.ffmpeg", preset_name);
   f = fopen(filename, "r");

On Windows fopen expects ANSI encoded strings, so we cannot change the encoding to UTF-8 without rewriting the rest of the function.

Ok, well maybe we should change that too, to use wchar paths (or utf8->whcar routines?). But maybe those are libavutil internals that cmdutils shouldn't use?

If we stick with this form, with ansi paths, it would be good to leave a comment at the call to wchartoansi(), to explain why that doesn't use UTF-8 like everything else.

// Martin

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to