From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Nextstep build uses iso-latin by default. WHY? Date: Sun, 20 Mar 2016 15:11:23 +0000 Message-ID: <20160320151123.GA65516@galloway.idiocy.org> References: <56E32A19.7060304@alice.it> <831t7givui.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1458486716 14432 80.91.229.3 (20 Mar 2016 15:11:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Mar 2016 15:11:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 20 16:11:55 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ahf1B-0002jx-IZ for ged-emacs-devel@m.gmane.org; Sun, 20 Mar 2016 16:11:49 +0100 Original-Received: from localhost ([::1]:53273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahf17-0000AC-Au for ged-emacs-devel@m.gmane.org; Sun, 20 Mar 2016 11:11:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahf0r-00008h-4R for emacs-devel@gnu.org; Sun, 20 Mar 2016 11:11:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahf0q-0000PC-4J for emacs-devel@gnu.org; Sun, 20 Mar 2016 11:11:29 -0400 Original-Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:38641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahf0p-0000Oc-IF for emacs-devel@gnu.org; Sun, 20 Mar 2016 11:11:28 -0400 Original-Received: by mail-wm0-x22a.google.com with SMTP id l68so94223334wml.1 for ; Sun, 20 Mar 2016 08:11:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gbczRwPhb+Jar2yTK+sN8cyE6PZ+2gVl+OfYCdYUUmE=; b=FsZq9SsM3mnk6Vn15iTR+W818clCrVTk497fdwLs1p7y06JhzNHL672q87Vabwad3L 8FexpABDFUD3F4zpZ1KAJX+memBo3ut7wAl/1JgKFYZ7pRi5dOnC5c7CiBVbW2OlFmAm nK4/BMU5/XCwTOY2EUA7GRLJdP08L5QbXaiITenCBAdZvoTmsZLiCKD0mkMFSCqKUWel +iKtAvQ3TVBzExFSQIXevbrn3nuaa9nHzzmwaIOXOLJ5alkqvke/71qPKB9F3sgx49df PnfCb7/Li1VLLQo297FcE0wqNu3+pa2crKhYOu2qFRN9720KwWoK8kwrJKQX1uWpW51M q43g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=gbczRwPhb+Jar2yTK+sN8cyE6PZ+2gVl+OfYCdYUUmE=; b=dqH9HVAp8G6Fw9IYg6WU4ykHPzjdQWBRLDkRBGY/kLbl4VYS0xDCPsie0xp+xi4HDu rs4+fTMYpMcrW/oYMk0cEYz7KMF+poNzwenYkWKUzLyp+x9gUV2fnqZfVxePkzqP31/9 e8/Z6FVgzkHwY93lZiYhmi2HpeLAo86N6aXnntEKq23wDL+xptm4FhCl8/XxyP0x6/wS Zy68LOHdwoYiGwQYESMPR5XE+U+7i2f2ZoXfmVVW3EN3/hGFVs0JRqh7hxyHqNxTNpDl 0uWOIz9lSFWkXtLkghTW/NEC7LbSIgeDHz+sKS6zFGEkjn5VDaWsmgcQRkotyBu/zfH1 3Kjw== X-Gm-Message-State: AD7BkJIaNhGAVtejkXzvLU50oTQS8++Lh8NUWNPCb7ATeAFnbWBDMkr3v/nCfKWGRuIVgg== X-Received: by 10.28.24.80 with SMTP id 77mr8796383wmy.16.1458486686772; Sun, 20 Mar 2016 08:11:26 -0700 (PDT) Original-Received: from galloway.idiocy.org (8.9.8.2.d.0.8.6.4.2.7.6.7.8.9.c.9.2.1.8.8.f.3.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:3f8:8129:c987:6724:680d:2898]) by smtp.gmail.com with ESMTPSA id av3sm21058062wjc.44.2016.03.20.08.11.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Mar 2016 08:11:26 -0700 (PDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201938 Archived-At: On Fri, Mar 11, 2016 at 05:41:11PM -0500, Stefan Monnier wrote: > > If you only want to have the files' default encoding be UTF-8, add > > this to your ~/.emacs: > > (setq-default buffer-file-coding-system 'utf-8) > > The OSX environment has always had a very strong bias towards utf-8, so > in the absence of a strong indication that something else than utf-8 is > desired, we should always use utf-8 on that platform. I asked a question about this before the changes were made, but nobody seemed to know the answer. I guess you maybe just missed the thread. Forcing Emacs to use UTF-8 would be trivial, we're currently pulling the locale value from the OS, and as far as I can tell it's always returned as something like "en_GB" rather than "en_GB.UTF-8". We can just append ".UTF-8" to the string before running setenv. My biggest concern about that is that I don't know if there are situations where [NSLocale localeIdentifier] will return ".UTF-8" or something else. Here's a patch to force UTF-8: src/nsterm.m (ns_init_locale): Append .UTF-8 to locale string. --- src/nsterm.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/nsterm.m b/src/nsterm.m index b796193..afb3357 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -596,8 +596,15 @@ ns_init_locale (void) @try { + /* It seems OS X should probably use UTF-8 everywhere. + 'localeIdentifier' does not specify the encoding, and I can't + find any way to get the OS to tell us which encoding to use, + so hard-code '.UTF-8'. */ + NSString *localeID = [NSString stringWithFormat:@"%@.UTF-8", + [locale localeIdentifier]]; + /* Set LANG to locale, but not if LANG is already set. */ - setenv("LANG", [[locale localeIdentifier] UTF8String], 0); + setenv("LANG", [localeID UTF8String], 0); } @catch (NSException *e) { -- Alan Third