From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#4047: 23.1.1: hexl-mode doesn't like UTF8 files with a byte-order mark Date: Thu, 27 Aug 2009 20:15:49 +0900 Message-ID: References: <20090807085054.036E61BF28D@ws1-10.us4.outblaze.com> <837hxemr9h.fsf@gnu.org> <831vnmmoe3.fsf@gnu.org> <83d46ykbte.fsf@gnu.org> <83ljldh5pm.fsf@gnu.org> <83praof8mu.fsf@gnu.org> Reply-To: Kenichi Handa , 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 1251372437 29680 80.91.229.12 (27 Aug 2009 11:27:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Aug 2009 11:27:17 +0000 (UTC) Cc: schwab@linux-m68k.org, 4047@emacsbugs.donarmstrong.com, bogossian@mail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 27 13:27:09 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 1Mgd8H-00045b-Gm for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Aug 2009 13:27:09 +0200 Original-Received: from localhost ([127.0.0.1]:48746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mgd8G-0004u9-2G for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Aug 2009 07:27:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mgd8B-0004u4-Lk for bug-gnu-emacs@gnu.org; Thu, 27 Aug 2009 07:27:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mgd87-0004tp-0I for bug-gnu-emacs@gnu.org; Thu, 27 Aug 2009 07:27:03 -0400 Original-Received: from [199.232.76.173] (port=58647 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mgd86-0004tm-TS for bug-gnu-emacs@gnu.org; Thu, 27 Aug 2009 07:26:58 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:32907) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mgd86-0003LD-Bz for bug-gnu-emacs@gnu.org; Thu, 27 Aug 2009 07:26:58 -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 n7RBQr6f024095; Thu, 27 Aug 2009 04:26:53 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7RBP6dU023797; Thu, 27 Aug 2009 04:25:06 -0700 Resent-Date: Thu, 27 Aug 2009 04:25:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kenichi Handa Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 27 Aug 2009 11:25:06 +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.125137175522412 (code B ref 4047); Thu, 27 Aug 2009 11:25:06 +0000 Original-Received: (at 4047) by emacsbugs.donarmstrong.com; 27 Aug 2009 11:15:55 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mx1.aist.go.jp (mx1.aist.go.jp [150.29.246.133]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7RBFqD1022409 for <4047@emacsbugs.donarmstrong.com>; Thu, 27 Aug 2009 04:15:54 -0700 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id n7RBFpdP020254; Thu, 27 Aug 2009 20:15:51 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id n7RBFpWc005680; Thu, 27 Aug 2009 20:15:51 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id n7RBFnJJ021699; Thu, 27 Aug 2009 20:15:50 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1MgcxJ-0002Y6-Tw; Thu, 27 Aug 2009 20:15:49 +0900 In-Reply-To: <83praof8mu.fsf@gnu.org> (message from Eli Zaretskii on Sat, 22 Aug 2009 13:25:13 +0300) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 27 Aug 2009 07:27:03 -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:30609 Archived-At: In article <83praof8mu.fsf@gnu.org>, Eli Zaretskii writes: > > At the moment, all I can say is that changing > > coding.h:encode_coding_string is quite safe. But, > > encode_coding_object is used by Lisp functions > > encode-coding-region and encode-coding-string, and thus the > > change will break some packages that use them on unibyte > > string/buffer. > I fixed this in encode-coding-string. I have overlooked this part: Stefan wrote: > 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). ^^^^^^^^^^^ We surely need eol conversion in sending a unibyte string to a process. So, I've just installed this change. 2009-08-27 Kenichi Handa * process.c (send_process): Use encode_coding_object instead of encode_coding_string to perform eol-conversion even if the string is unibyte. Index: process.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/process.c,v retrieving revision 1.593 retrieving revision 1.594 diff -u -r1.593 -r1.594 --- process.c 17 Aug 2009 21:04:07 -0000 1.593 +++ process.c 27 Aug 2009 11:12:54 -0000 1.594 @@ -5721,7 +5721,8 @@ } else if (STRINGP (object)) { - encode_coding_string (coding, object, 1); + encode_coding_object (coding, object, 0, 0, SCHARS (object), + SBYTES (object), Qt); } else { --- Kenichi Handa handa@m17n.org