[FFmpeg-devel] [PATCH] Support for UTF8 filenames on Windows

Karl Blomster thefluff
Thu Jul 16 20:11:22 CEST 2009


Ramiro Polla wrote:
> Hi,
> 
> On Thu, Jul 16, 2009 at 11:20 AM, Karl Blomster<thefluff at uppcon.com> wrote:
>> Unless I am severely missing something in your updated patch (thanks for the
>> nice work, by the way!) it will not work with the FFmpeg commandline
>> program. If you want an Unicode commandline in Windows you need to use
>> wmain() or _tmain() instead of plain old main(), AFAIK. As I said earlier my
>> original patch was only intended to let the API support Unicode. Working it
>> into ffmpeg.c would be a lot more work, I think.
> 
> How do you test UNICODE support?
> 
> I used attached shell file with msys (sh test_unicode.sh) and it works
> as expected (only the unicode filename without FF_WINUTF8 fails). I
> also tested with an app that used Find(First,Next)FileA() and passed
> the unicode filenames as ascii string to ff_winutf8_open() and it also
> worked as expected.

Actually, I just realized that MinGW is probably not Unicode aware at all. Most 
likely it's calling CreateProcessA() and passing the data as if it was ASCII, 
which actually ends up working as expected. cmd.exe on the other hand is doing 
what passes for the Right Thing on Windows and is calling CreateProcessW(), 
which passes the commandline as a wchar_t*, and then things go wrong since 
ffmpeg doesn't have a widechar main() to call.

Regards,
Karl Blomster



More information about the ffmpeg-devel mailing list