emacs-devel
[Top][All Lists]
Advanced

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

Re: getpwent, user-full-name and utf-8


From: Jan Djärv
Subject: Re: getpwent, user-full-name and utf-8
Date: Thu, 22 Mar 2007 09:17:05 +0100
User-agent: Thunderbird 1.5.0.10 (X11/20070302)



David Kastrup skrev:
Jan Djärv <address@hidden> writes:

David Kastrup skrev:
Eli Zaretskii <address@hidden> writes:

From: David Kastrup <address@hidden>
Date: Wed, 21 Mar 2007 10:58:08 +0100

I propose that we bite the bullet, assume a fixed external system
encoding of utf-8 for such strings, and recode accordingly.
I'd rather assume that usernames are encoded in the locale's
encoding, not necessarily in UTF-8.
That assumes that every user operates under the same locale, and that
this locale agrees with the locale of the system files.  In particular
on multi-user machines, that is not realistic.
Since users themselves can set their full name,

Since when?

Well, I took a look at the manual page of passwd(1) on my GNU/Linux
system, and the description indeed says:

        passwd also changes account information, such as the full
        name of the user, the user's login shell, or his/her
        password expiry date and interval.

Amusingly, however, there is no option for doing any of that except
the password related stuff.

There is, however,

CHFN(1) -- 06/06/2006 -- User Commands

Yes that is what I meant.


...
        /etc/login.defs. (The default configuration is to prevent
        users from changing their fullname.)




So with the default settings, a user can't change his settings.

Ok, I haven't seen that restriction before.


I'd think the user locale would be a good choice.

It is not the worst choice, but I consider it likely that a better way
would be something like a separate "system locale".  For lack of
better information, one could let it default to the user locale, but
it should be at least configurable separately.

Does anybody have access to the X/Open or Posix specs?  Maybe
something is said about this in there.


They don't say anything, they don't specify any passwd or chfn program. The description of <pwd.h> just says:

  The <pwd.h> header shall provide a definition for struct passwd, which shall
  include at least the following members:

  char    *pw_name   User's login name.
...

and that is about it.

I checked some of the machines I have accounts on, but no admin access to, and they all use Latin-1 (which BTW is not my locale, UTF-8 is). So some system locale may not be a bad idea, but default UTF-8 is OK.

        Jan D.




reply via email to

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