From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: auto-recognizing utf-16le ? Date: Tue, 16 Jun 2009 11:04:15 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1245117891 5169 80.91.229.12 (16 Jun 2009 02:04:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Jun 2009 02:04:51 +0000 (UTC) Cc: emacs-devel@gnu.org, miles@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 16 04:04:48 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MGO2Z-00005G-Jt for ged-emacs-devel@m.gmane.org; Tue, 16 Jun 2009 04:04:47 +0200 Original-Received: from localhost ([127.0.0.1]:41337 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGO2Z-0005wH-6Z for ged-emacs-devel@m.gmane.org; Mon, 15 Jun 2009 22:04:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGO2F-0005sR-Ui for emacs-devel@gnu.org; Mon, 15 Jun 2009 22:04:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGO2B-0005oP-BB for emacs-devel@gnu.org; Mon, 15 Jun 2009 22:04:27 -0400 Original-Received: from [199.232.76.173] (port=50373 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGO2A-0005oM-Gm for emacs-devel@gnu.org; Mon, 15 Jun 2009 22:04:23 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:40496) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGO27-0006BX-Ib; Mon, 15 Jun 2009 22:04:20 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id n5G24GLt002576; Tue, 16 Jun 2009 11:04:17 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id n5G24GDL025882; Tue, 16 Jun 2009 11:04:16 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id n5G24FEB008457; Tue, 16 Jun 2009 11:04:15 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1MGO23-0006ma-LK; Tue, 16 Jun 2009 11:04:15 +0900 In-reply-to: (message from Andreas Schwab on Mon, 15 Jun 2009 23:45:34 +0200) X-detected-operating-system: by monty-python.gnu.org: Solaris 9 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:111536 Archived-At: In article , Andreas Schwab writes: > Miles Bader writes: > > Someone on #emacs noticed that emacs doesn't seem to auto-recognize > > files encoding using utf-16le. > UTF-16 detection never tries to auto detect files without a signature. No. detect_coding_utf_16 tries to check if the file is UTF-16 or not by checking the dispersion of Eth and Oth bytes where E is even and O is odd. But, there were two bugs in the code. One was already fixed by this change. 2009-06-15 Andreas Schwab * coding.c (detect_coding_utf_16): Fix typo counting odd bytes. And, I've just installed a fix of another bug. So, with the latest code, if you set inhibit-null-byte-detection to t, and prefer utf-16be and/or utf-16le, Emacs will detect UTF-16 files without BOM in most cases. --- Kenichi Handa handa@m17n.org