GLib filename charsets [Re: Can someone please comment on this short program]



Hi,

On Wed, 14 Dec 2005 11:06:21 +0900, dannym wrote:
...
> That said, I have no idea how the filename_to_utf8 finds out what
> encoding the original filename is in... I wouldn't know how to find out
> at all...

It checks glibc-based locale(7) together with ENV("G_FILENAME_ENCODING") and
ENV("G_BROKEN_FILENAMES"), generally undebuggable.


> the kernel is basically ignorant about filename encodings so it just passes
> whatever bytes it finds.

It is a pity the userland uses glibc-based locale(7) style Linux kernel uses
its own charset settings for mount(8). And I found out the GNU/Linux
distributions generally do not match these two settings together.

While users manage to set the primitive but direct Linux kernel mount(8)
settings it is lethal for them to fix glibc-based locale(7) ENV variables.


It may make sense to implement Linux kernel specific handling of filenames for
GLib - it would check the mountpoint and its current Linux kernel parameters
from some "/proc/mounts" or "/etc/mtab". If it would be successful these found
settings would override anything found in glibc-based locale(7) and those ENV()
variables theoretically correct but practically unusable.


Regards,
Lace



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]