[FFmpeg-devel] file protocol with Unicode support

Kirill Gavrilov gavr.mail at gmail.com
Wed Apr 13 09:08:58 CEST 2011


> All strings in libav* are UTF-8 if I remember correctly. Or at least
> supposed to.
> Hence I suggest patching the existing file protocol so that for WIN32 it
> does the UTF-8 -> wchar_t conversion etc. Maybe someone else has a better
> idea?
>
Internal string in library are assumed as UTF-8. However file paths is an
alien data given by user (using av_open_input_file() function for example).
And because this function has an char* interface paths are probably given in
system default Windows ANSI code page. Trying to always convert input
strings as UTF-8
probably broke many applications...

The file protocol works fine for UTF-8 paths on Linux based systems last
> time I checked.
>
Thats because most Linux distributions migrate to UTF-8 as a main charset
for filesystems and etc. But Windows had another traditions and it uses
UTF-16 + ANSI code page
since WinNT (and most functions has two equivalents - ANSI and Unicode).

2011/4/13 Tomas Härdin <tomas.hardin at codemill.se>

> Kirill Gavrilov skrev 2011-04-12 22:24:
>
>  Hi, I'm newbie here.
>>
>> No Unicode API in FFmpeg make me very sad (this is important only for
>> Windows applications).
>> I partially investigate the current i/o and found that creating Unicode
>> versions for major functions cause to create the tons of another stuff.
>> But I found another 'stupid' way - I define new fileU protocol which
>> assume
>> the input path is in utf-8, automatically converts it to the utf16 string
>> and use Unicode function to open the file.
>>
>
> All strings in libav* are UTF-8 if I remember correctly. Or at least
> supposed to.
> The file protocol works fine for UTF-8 paths on Linux based systems last
> time I checked. Hence I suggest patching the existing file protocol so that
> for WIN32 it does the UTF-8 -> wchar_t conversion etc. Maybe someone else
> has a better idea?
>
> /Tomas
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

-----------------------------------------------
Kirill Gavrilov,
Software designer.


More information about the ffmpeg-devel mailing list