From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22436: read-coding-system uses wrong default when called from write-file Date: Sat, 23 Jan 2016 15:46:02 +0200 Message-ID: <8337to5rz9.fsf@gnu.org> References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1453556787 24224 80.91.229.3 (23 Jan 2016 13:46:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jan 2016 13:46:27 +0000 (UTC) Cc: rcopley@gmail.com, 22436@debbugs.gnu.org To: Lars Magne Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 23 14:46:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1aMyW7-0005cS-4F for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jan 2016 14:46:15 +0100 Original-Received: from localhost ([::1]:57410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMyW6-00042O-70 for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jan 2016 08:46:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMyW2-00042E-FV for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2016 08:46:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMyVz-0003XG-4P for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2016 08:46:10 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMyVz-0003XB-11 for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2016 08:46:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aMyVt-00032V-O1 for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2016 08:46:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jan 2016 13:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22436 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22436-submit@debbugs.gnu.org id=B22436.145355676011676 (code B ref 22436); Sat, 23 Jan 2016 13:46:01 +0000 Original-Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 13:46:00 +0000 Original-Received: from localhost ([127.0.0.1]:58402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMyVo-00032C-Rh for submit@debbugs.gnu.org; Sat, 23 Jan 2016 08:46:00 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44932) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMyVk-00031x-PF for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 08:45:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMyVb-0003UX-GZ for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 08:45:47 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMyVb-0003UT-Cq; Sat, 23 Jan 2016 08:45:43 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2220 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMyVa-00010R-Jf; Sat, 23 Jan 2016 08:45:43 -0500 In-reply-to: (message from Lars Magne Ingebrigtsen on Sat, 23 Jan 2016 14:12:20 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111889 Archived-At: > From: Lars Magne Ingebrigtsen > Cc: Richard Copley , 22436@debbugs.gnu.org > Date: Sat, 23 Jan 2016 14:12:20 +0100 > > Eli Zaretskii writes: > > > Your locale's default encoding, cp1252, cannot encode this character, > > so Emacs asked you to provide an encoding that can, and offered > > chinese-iso-8bit as the default. > > While correct, it is a slightly less than helpful default. It's not a default, it's just the first member of a list sorted according to some comparison function. > Most people deal (at most) with two charsets: One local, and if not, > then Unicode. That's only correct if the encoded text is going to be used on the same platform. This email message is an excellent example where this logic is simply false, because you and I live in different locales, and "Unicode" means different things to us. (Anyway, when you say "most people", did you consider how many people in the world consider chinese-iso-8bit a very good first choice? ;-) > Which would be utf8 on most systems, and possibly ucs16 on Windows, > I dunno. Using UTF-16 on Windows would be disastrous: almost no program, certainly not those which are ports of GNU software, can do anything useful with such an encoding. Emacs is the only exception I know of. > So `chinese-iso-8bit' is a surprising default. It's not a default. > Could the default be improved upon? We can sort the list differently. But if all we want is to always get UTF-8 at the head, there's a much easier way, see my other message where I mentioned prefer-coding-system.