From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Fcall_process: wrong conversion Date: Mon, 15 May 2006 12:06:48 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1147709478 27010 80.91.229.2 (15 May 2006 16:11:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 15 May 2006 16:11:18 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 15 18:11:15 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fffeo-0005xN-PU for ged-emacs-devel@m.gmane.org; Mon, 15 May 2006 18:10:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fffeo-0002YG-1i for ged-emacs-devel@m.gmane.org; Mon, 15 May 2006 12:10:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fffat-0000qt-J0 for emacs-devel@gnu.org; Mon, 15 May 2006 12:06:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fffas-0000qL-1V for emacs-devel@gnu.org; Mon, 15 May 2006 12:06:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fffar-0000qG-R8 for emacs-devel@gnu.org; Mon, 15 May 2006 12:06:49 -0400 Original-Received: from [209.226.175.93] (helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FffdJ-0004H2-Bp for emacs-devel@gnu.org; Mon, 15 May 2006 12:09:21 -0400 Original-Received: from localhost ([70.53.193.91]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060515160648.DCJW13653.tomts36-srv.bellnexxia.net@localhost>; Mon, 15 May 2006 12:06:48 -0400 Original-Received: by localhost (Postfix, from userid 20484) id 0E5757EC9; Mon, 15 May 2006 12:06:48 -0400 (EDT) Original-To: "Herbert Euler" In-Reply-To: (Herbert Euler's message of "Mon, 15 May 2006 23:17:06 +0800") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:54513 Archived-At: > - Create a file contains UTF-16 text, either UTF-16BE or UTF-16LE > is OK. For example, create a file contains "a" in UTF-16LE as > its content and name this file with "1". [...] > - In case the buffer is encoded with utf-16-le, the content is > displayed as "a". Type M-x hexl-mode RET, the result is > \377?: Invalid argument > displayed in the buffer. Thanks. I've installed the patch below which should fix the problem. Please confirm, Stefan --- hexl.el 11 avr 2006 12:45:49 -0400 1.103 +++ hexl.el 15 mai 2006 12:02:32 -0400 @@ -704,7 +704,12 @@ (buffer-undo-list t)) (apply 'call-process-region (point-min) (point-max) (expand-file-name hexl-program exec-directory) - t t nil (split-string hexl-options)) + t t nil + ;; Manually encode the args, otherwise they're encoded using + ;; coding-system-for-write (i.e. buffer-file-coding-system) which + ;; may not be what we want (e.g. utf-16 on a non-utf-16 system). + (mapcar (lambda (s) (encode-coding-string s locale-coding-system)) + (split-string hexl-options))) (if (> (point) (hexl-address-to-marker hexl-max-address)) (hexl-goto-address hexl-max-address))))