From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: getpwent, user-full-name and utf-8 Date: Thu, 22 Mar 2007 11:30:16 +0900 Organization: NEC Electronics Message-ID: References: <86zm66q5ov.fsf@lola.quinscape.zz> <857itanwvc.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1174530649 13507 80.91.229.12 (22 Mar 2007 02:30:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Mar 2007 02:30:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 22 03:30:43 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HUD4c-0008LA-2W for ged-emacs-devel@m.gmane.org; Thu, 22 Mar 2007 03:30:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUD6L-0003sJ-Q4 for ged-emacs-devel@m.gmane.org; Wed, 21 Mar 2007 21:32:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HUD6I-0003sB-A5 for emacs-devel@gnu.org; Wed, 21 Mar 2007 22:32:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HUD6E-0003rz-JH for emacs-devel@gnu.org; Wed, 21 Mar 2007 22:32:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUD6E-0003rw-Ec for emacs-devel@gnu.org; Wed, 21 Mar 2007 21:32:22 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HUD4T-0001GV-QX for emacs-devel@gnu.org; Wed, 21 Mar 2007 22:30:34 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HUD4M-0003x6-2z for emacs-devel@gnu.org; Thu, 22 Mar 2007 03:30:26 +0100 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Mar 2007 03:30:26 +0100 Original-Received: from miles.bader by fencepost.gnu.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 22 Mar 2007 03:30:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: fencepost.gnu.org System-Type: i686-pc-linux-gnu Blat: Foop Cancel-Lock: sha1:ktg1mCJ/rFyPXUQDAskq2R7mqxg= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68264 Archived-At: David Kastrup writes: > Eli Zaretskii writes: >> 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. ... > For current systems, assuming utf-8 will likely be correct most of the > time, at least. Do you have any data to back that up? If you think of multiuser systems versus single-user systems, I'd think: * On a single-user systems, the user's locale would often match /etc/passwd. * Multi-user systems tend to be much longer-lived (I think much of the data on the servers at my work dates back 15 years or more -- often the hardware gets upgraded, but the user-related data is just kept verbatim from the old system), and in many cases probably have user databases that predate widespread use of utf-8. In europe I guess that would mean they use latin-XX. There's really no way you can always get it right, but my intuition is that the safest thing to do is use the locale as Eli suggests. Of course you're right that emacs-mule is basically never correct... (maybe there are some crazies out there though :-) -Miles -- Is it true that nothing can be known? If so how do we know this? -Woody Allen