From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#4047: 23.1.1: hexl-mode doesn't like UTF8 files with a byte-order mark Date: Mon, 10 Aug 2009 15:45:29 -0400 Message-ID: References: <20090807085054.036E61BF28D@ws1-10.us4.outblaze.com> <837hxemr9h.fsf@gnu.org> <831vnmmoe3.fsf@gnu.org> Reply-To: Stefan Monnier , 4047@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249934887 17253 80.91.229.12 (10 Aug 2009 20:08:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Aug 2009 20:08:07 +0000 (UTC) Cc: 4047@emacsbugs.donarmstrong.com, bogossian@mail.com To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 10 22:07:59 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mab9x-0002Hm-RO for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Aug 2009 22:07:58 +0200 Original-Received: from localhost ([127.0.0.1]:47758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mab9w-0005UC-RU for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Aug 2009 16:07:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mab93-00053G-AG for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 16:07:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mab8x-00050i-Gi for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 16:06:59 -0400 Original-Received: from [199.232.76.173] (port=45184 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mab8x-00050Z-6W for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 16:06:55 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:33272) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mab8w-0002py-GP for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2009 16:06:54 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7AK6mH7026564; Mon, 10 Aug 2009 13:06:51 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7AJt5NS024533; Mon, 10 Aug 2009 12:55:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 10 Aug 2009 19:55:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4047 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4047-submit@emacsbugs.donarmstrong.com id=B4047.124993353723925 (code B ref 4047); Mon, 10 Aug 2009 19:55:05 +0000 Original-Received: (at 4047) by emacsbugs.donarmstrong.com; 10 Aug 2009 19:45:37 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7AJjaEX023912 for <4047@emacsbugs.donarmstrong.com>; Mon, 10 Aug 2009 12:45:37 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAKYVgEpFxL8W/2dsb2JhbACBUtAthBgFgUyFbA X-IronPort-AV: E=Sophos;i="4.43,355,1246852800"; d="scan'208";a="43259121" Original-Received: from 69-196-191-22.dsl.teksavvy.com (HELO pastel.home) ([69.196.191.22]) by ironport2-out.teksavvy.com with ESMTP; 10 Aug 2009 15:45:15 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id E888E8370; Mon, 10 Aug 2009 15:45:29 -0400 (EDT) In-Reply-To: (Andreas Schwab's message of "Sat, 08 Aug 2009 16:29:31 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 10 Aug 2009 16:06:59 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30072 Archived-At: >> Btw, I doubt that any encoding that uses BOM can ever be appropriate >> for encoding command-line arguments. Maybe we should treat them >> specially in call-process and its ilk. > The bug is that hexlify-buffer assumes that manually encoding the > command line stops call-process from encoding it again, which does not > work: coding-system-for-write takes absolute precedence. IMHO > call-process should not use coding-system-for-write for encoding the > command line, if at all there should be a separate override. I believe we've bumped into this problem already in the past. To me, it's clear that call-process should be careful about coding arguments, since the coding-system to use may depend on the argument and/or the command, so in general the caller will want to specify explicitly some coding system for the arguments, including a different coding system for each argument. An override var might be a good idea, but it won't cater to the case where each arg requires a different encoding, so the most important thing is to make sure that unibyte args don't get re-encoded. Unless Handa objects, I'd recommend we change encode_coding_string to be a nop on unibyte strings (tho, we may want to let it obey EOL conversions). If there are good reasons not to do that, then Fcall_process should be changed to not call encode_coding_string on unibyte strings. Stefan