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#1654: 23.0.60; auto encoding detection (detect-coding-region) not working Date: Fri, 27 Mar 2009 13:34:19 +0900 Message-ID: References: <87k56bu0uu.fsf@cyd.mit.edu> Reply-To: Kenichi Handa , 1654@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1238129047 27160 80.91.229.12 (27 Mar 2009 04:44:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Mar 2009 04:44:07 +0000 (UTC) Cc: poppyer@gmail.com, 1654@emacsbugs.donarmstrong.com To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 27 05:45:24 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 1Ln3wY-00022a-4y for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Mar 2009 05:45:22 +0100 Original-Received: from localhost ([127.0.0.1]:43566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ln3vA-000509-SR for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Mar 2009 00:43:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ln3v6-000504-SQ for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2009 00:43:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ln3v2-0004zs-66 for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2009 00:43:52 -0400 Original-Received: from [199.232.76.173] (port=35546 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ln3v2-0004zp-0H for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2009 00:43:48 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:48933) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ln3v1-0003te-EA for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2009 00:43:47 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2R4hjUH031583; Thu, 26 Mar 2009 21:43:45 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n2R4e5iG030504; Thu, 26 Mar 2009 21:40:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kenichi Handa Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 27 Mar 2009 04:40:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1654 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1654-submit@emacsbugs.donarmstrong.com id=B1654.123812842529051 (code B ref 1654); Fri, 27 Mar 2009 04:40:05 +0000 Original-Received: (at 1654) by emacsbugs.donarmstrong.com; 27 Mar 2009 04:33:45 +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.13.8/8.13.8/Debian-3) with ESMTP id n2R4Xf9Q029044 for <1654@emacsbugs.donarmstrong.com>; Thu, 26 Mar 2009 21:33:42 -0700 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id n2R4Xd3T025471; Fri, 27 Mar 2009 13:33:39 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id n2R4XdQO022054; Fri, 27 Mar 2009 13:33:39 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id n2R4XdBH009073; Fri, 27 Mar 2009 13:33:39 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1Ln3lr-0002Lo-0e; Fri, 27 Mar 2009 13:34:19 +0900 In-reply-to: <87k56bu0uu.fsf@cyd.mit.edu> (message from Chong Yidong on Thu, 26 Mar 2009 22:59:53 -0400) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Fri, 27 Mar 2009 00:43:52 -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:26662 Archived-At: In article <87k56bu0uu.fsf@cyd.mit.edu>, Chong Yidong writes: > Hi Handa-san, > Could you take a look at bug#1654? Thanks. > http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1654 Ok, but I can't reproduce the problem for test_gbk.txt. What is shown by C-h C RET? Gaofeng Huang wrote: > Important settings: [...] > value of $LC_CTYPE: zh_CN.UTF-8 So, I installed that locale, and ran Emacs under it. The file test_gbk.txt was correctly detected as GBK. But, as the byte sequence pattern of GBK and Big5 is not distinguishable, it is impossible to make Emacs detect both files correctly at the same time. By the way, as the file test_big5.txt is completely the same as test_gbk.txt, I changed the encoding of test_big5.txt to Big5 by iconv, and tested with it. > The auto encoding detection can not detect the correct encoding (for > example, for the two files attached). And neither the > detect-coding-region function works (after M-x find-file-literally) At least detect_coding_region works correctly for test_gbk.txt. But, it doesn't work for test_big5.txt by the same reason as above. If you want to read Big5 file correctly, do something like this: C-x C-m c big5 RET C-x C-f _FILENAME_ or change the language environment to Chinese-BIG5 by: C-x C-m l Chinese-BIG5 RET or run Emacs under Big5 locale. --- Kenichi Handa handa@m17n.org