Re: Natilus using UTF-8 for filenames regardless of locale



On Fri, 2004-07-16 at 11:27, Mika Fischer wrote:
> On Fri, 16 Jul 2004 14:59:30 +0200 Alexander Larsson wrote:
> > This is the general behaviour in Gnome (this should be in some FAQ). If
> > you want to use locale-dependent encoding for filenames, set the
> > environment variable G_BROKEN_FILENAMES.
> 
> Yes, that fixes it. Thanks for that!
> 
> Can you tell me the rationale for this decision? I can't make any sense of
> it. If the user has set his locale he probably wants it respected.

The problem is that it doesn't work to use locale-encoded filenames:

 - Multiple people on the system may have different locales
 - If you create a tarball on your system, how should the
   filenames be encoded?
 - If the kernel is converting Windows filenames from a VFAT
   or SMB filesystem it has to choose a single encoding; that
   encoding can't depend on the user's environment.

Etc. So the default we chose for GLib was to do something that
at least works from one Glib/GNOME app to another. Many distributors
(including Red Hat) do turn G_BROKEN_FILENAMES by default.

Because people found "G_BROKEN_FILENAMES" a little offensive, we
deprecated this naming in GLib-2.4 in favor of something else:
 
 G_FILENAME_ENCODING= locale
 G_FILENAME_ENCODING=ISO-8859-1

> Also, can you tell me why Nautilus displays Filenames in different
> character sets correctly? How the hell does it figure out the correct
> cahracter set? This has the same taste as IE guessing the character set
> used in HTML-Pages...

UTF-8 is an encoding of the Unicode character set and thus can basically
handle all the world's languages. There is no guessing going on.

> The point I'm trying to make is that all of this breaks down horribly if
> you ever use something apart from Gnome, which I think is not something
> one should aim for...

To get filenames working correctly, you need to use a UTF-8 locale.
That's it.

Regards,
						Owen

Attachment: signature.asc
Description: This is a digitally signed message part



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