[Top][All Lists]

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

Re: file names encoding on Windows

From: Eli Zaretskii
Subject: Re: file names encoding on Windows
Date: Sat, 09 Jul 2011 14:08:25 +0300

> From: Bruno Haible <address@hidden>
> Date: Sat, 9 Jul 2011 11:59:13 +0200
> Cc: Eric Blake <address@hidden>,
>  address@hidden,
>  address@hidden,
>  address@hidden,
>  address@hidden
> > I'm not sure.  At least for Windows, `locale_charset' is not necessarily 
> > TRT.
> What is the "right thing" for detecting the encoding of file names on Windows,
> if not GetACP()?

GetACP is correct for ANSI APIs, but not for "wide" (a.k.a. Unicode)
APIs.  The latter use UTF-16, because that's how the Windows
filesystems encode the file names, at least with NTFS.  I'm sure you
already know all that.

> > Would it make sense to let the user specify the local encoding, at
> > least as an option?
> No, because the encoding is not the only aspect of cultural conventions.
> There's also the language, the sort order, and more.

How are these relevant to the specific issue of encoding of the file
name passed to uuencode?  The suggestion was to let the user specify
the encoding of the file name, and _only_ that encoding.

> The user has the possibility to set a locale in the Windows Control
> Panel. But it does not allow to change the encoding.

One _can_ change the encoding via the Control Panel, and that does
affect GetACP, AFAIK (if you logout/login after changing the current
setting).  But again, I don't see how is this relevant to the issue at

It sounds possible, even if improbable, that the locale's charset is
set incorrectly, in which case locale_charset will return a wrong
value.  I'm asking whether it would be a good idea to cater to such
situations, however improbable they sound, by providing a user option.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]