[FFmpeg-devel] file protocol with Unicode support

Kirill Gavrilov gavr.mail at gmail.com
Thu Apr 14 09:11:07 CEST 2011


2011/4/14 Michael Niedermayer <michaelni at gmx.at>

> > even in existing code. However some people that currently can enter
> > filenames in
> > system-defined code page (and contains the symbols outside the ASCII)
> will
> > got open file error.
> We should keep supporting that mode and make the others options somehow
>
thats why I suppose to create another file protocol at first. Sure, another
protocol is not good solution
- I'm not sure that developers are familiar with protocols list supported by
FFmpeg.

One trick we can do - to check the file exists (assume input is not UTF-8
string) and
convert UTF-8 -> wide char if not. But this will work only for open file
operation
and file creation will be undefined.

Another solution with backward compatibility is to create the duplicates for
some entry functions
like av_open_input_file() and av_open_input_fileU(). Thats really how most
libraries works
(FreeImage for input filenames, FTGL to render the text, DevIL has macro to
switch all functions).
In general function we will perform explicit conversion from current code
page (CP_ACP) to UTF_8
and in wide-char function duplicator from UTF-16 -> UTF-8. Thus only first
step will be changed
and other will stay unchanged (except file open function which will
convert UTF-8
to wide chars).
Thus existing entry functions will not change their meaning and
Win-developers
may optionally use Unicode duplicates.

2011/4/14 Michael Niedermayer <michaelni at gmx.at>

> On Wed, Apr 13, 2011 at 04:14:22PM +0400, Kirill Gavrilov wrote:
> > 2011/4/13 Nicolas George <nicolas.george at normalesup.org>
> >
> > > As for the solution to your problem, I believe the best solution is to
> > > replace the open call in os_support.c.
> > >
> > Something like this (in attach)?
> >
> > Having a different protocol will just make things more messier.
> > >
> > But parsing input file name as UTF-8 only for Windows we make confusion
> in
> > API.
> > As for me - there no much difference and these changes will not broke
> open
> > procedure
>
> > even in existing code. However some people that currently can enter
> > filenames in
> > system-defined code page (and contains the symbols outside the ASCII)
> will
> > got open file error.
>
> We should keep supporting that mode and make the others options somehow
>
> [...]
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> DNS cache poisoning attacks, popular search engine, Google internet
> authority
> dont be evil, please
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk2mG6oACgkQYR7HhwQLD6ujhQCfdbT1Ao/eUqf3JQFRYcHDtMWW
> aVAAn0UJKdNS6YEiNCKnNFA魃戒ꄻ
> =G4uu
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> 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