> From: Bruno Haible <[email protected]> > Date: Sat, 9 Jul 2011 11:59:13 +0200 > Cc: Eric Blake <[email protected]>, > [email protected], > [email protected], > [email protected], > [email protected] > > > 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 hand. 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.
