[MPlayer-users] MPlayer won't open filenames with non latin characters

Rich Felker dalias at aerifal.cx
Thu Dec 20 06:54:53 CET 2007


On Thu, Dec 20, 2007 at 02:26:59AM +0100, RVM wrote:
> Is this a bug?

Yes, in Windows, or rather the mingw (msvc) and cygwin runtimes. I
have an idea for patching them up with a wrapper which would provide a
working UTF-8 environment to the application through which all
filenames would be accessible, but as I'm not a windows user I have
little interest in writing it myself, nor the ability to test it. If
you know someone willing to implement it I would be happy to explain
the idea. It could work as a wrapper at the application level but
ideally it would be integrated into the mingw and cygwin libraries.

> I don't know if this problem happens under Linux too. I couldn't test it. My 
> system is configured to ISO-8859-15 and konqueror doesn't even allow me to 
> create such a filename.

This is because filenames on Unix systems are traditionally byte
strings and interpreted according to the locale environment. As such
it's not possible to store characters that do not exist in the
locale's encoding. On the other hand, Windows filenames are internally
UTF-16 (uhg). Applications using the standard C/POSIX functions for
accessing the filesystem see them translated through a particular
legacy encoding determined by the language selection in Windows;
filenames with characters outside this character set are then
inaccessible. Applications can use the Windows-proprietary UTF-16 API
for accessing the filesystem, but this will not be supported in
MPlayer because it's fundamentally the Wrong Thing™. Instead, wrapper
implementations of the standard C/POSIX functions which translate
between UTF-8 and UTF-16 should be provided so that applications (like
MPlayer) using the standard functions have access to all filenames. A
similar wrapper layer is also needed around main() to convert the
command line.

Rich



More information about the MPlayer-users mailing list