Re: Nautilus broken filename compatibility



Darin Adler <darin bentspoon com> writes:

> On 3/1/02 3:35 PM, "Owen Taylor" <otaylor redhat com> wrote:
> 
> > If neither is set, or they are set to C, then your charset is ASCII,
> > and if anything works, you are just getting lucky or, to put it
> > another way surviving because people have abused the locale facilities
> > long enough that there are a lot of hacks around to work even when you
> > don't have a proper locale.
> 
> OK. Well the reason I ask this is the hack in Nautilus to interpret
> filenames. If a filename is good UTF-8, then there's no issue. Or if the
> filename gets properly converted to UTF-8 by g_filename_to_utf8 because
> G_BROKEN_FILENAMES is set, we're also fine.
> 
> But there's also code in there to say, "if it's not good UTF-8, then see if
> we can decode it using the locale-specific character set". That's
> specifically so that filenames that look good in the terminal don't look
> wrong in Nautilus for pedantic reasons. It's used only on the display side,
> not on the renaming side.
> 
> I could leave this hack out altogether, and it wouldn't bother me, but it
> would bother others I think. If the hack *is* in there, it's really sad that
> the compatibility hack is stricter than gnome-terminal! Any ideas on how a
> good way to do better than g_locale_to_utf8 for this hack? I'd really like
> to get past this and on to other things.
> 
> Even if I get this just right, I suspect that the other side (names written
> out when renaming and copying) is going to cause trouble.

Well, you _could_ say, if the locale's charset is ASCII, then assume ISO-8859-1.
It's grossly euro-centric and broken, but...

I'm certainly not going to add that to GLib. (I am thinking of supplementing
G_BROKEN_FILENAMES with something like FILESYSTEM_ENCODING, which one could
use.)

(gnome-terminal, if you have certain correctness configuration options off
assumes that the charset is the charset of the font, which is why it is
"working", but you don't have that option.)

But the basic answer, is, if the user logs into GNOME with their locale set 
to C, we need to pop up a dialog telling them how to change it and not
let them continue until they do.

Regards,
                                        Owen



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