2011/4/15 Luca Barbato <[email protected]>

>     > This is an alien string and if there are no *agreement* the string
> could be
>     On other systems we pass the string to open() and it works as expected,
>     on it doesn't work as expected, am I wrong?
>
If other system configured to locale with KOI8-R encoding (for example) and
tries to mount an
alien ext* filesystem used on alien system configured to CP1251 encoding
(for example) than
you'll see the trash in your file browser and all file functions will work
'as expected'.
Thats why you can don't care about encoding when using file system access
functions.

Modern Linux system consider UTF-8 as general encoding for string
(filesystems, GUI)
and now most systems are coherent at this point.

On Windows additional Unicode layer was added and general functions are
leaved untouched.
Thus localized application written for specified language works as expected
on new systems
(even on Windows XP, Windows Vista and Windows 7!).

But Win32 applications that want to provide full Unicode support should use
Unicode layer (wchar_t* ).
NTFS stores filenames in UTF-16 (I assume) and when you work with ANSI layer
functions
the symbols outside current code page are degraded (replaced with similar or
special characters).

Them still can be represented (if languages not too different) but can not
be used to open file
(because conversion is lossy!). And only Unicode layer can be used instead.
Also short name trick can be used to open Unicode filenames using general
functions but
this outside this discussion.

Because Windows migrate to Unicode with backward compatibility and provide
special
Unicode level there are no reasons to change ANSI code pages to UTF-8 it in
nearest future.

So, the problem is that using general file access functions you can not
access Unicode filenames
in Windows (without tricks) and on other systems you may be aware of
encoding at all
(if you do not represent strings in GUI and so on). Just because Windows
decide to declare
special Unicode level and other systems doesn't turn the same way.
-----------------------------------------------
Kirill Gavrilov,
Software designer.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to