From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kazuhiro Ito Newsgroups: gmane.emacs.bugs Subject: bug#9318: 23.3.50; The first call of encode-coding-region() returns wrong result on on Windows Date: Thu, 18 Aug 2011 18:01:13 +0900 Message-ID: <20110818090129.DC129360038@msa102.auone-net.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI-EPG 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1313658134 606 80.91.229.12 (18 Aug 2011 09:02:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 18 Aug 2011 09:02:14 +0000 (UTC) To: 9318@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 18 11:02:11 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QtyUM-0003po-BF for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Aug 2011 11:02:10 +0200 Original-Received: from localhost ([::1]:33850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtyUL-0005DQ-JF for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Aug 2011 05:02:09 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtyUH-0005D5-QM for bug-gnu-emacs@gnu.org; Thu, 18 Aug 2011 05:02:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QtyUG-0005a5-RZ for bug-gnu-emacs@gnu.org; Thu, 18 Aug 2011 05:02:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtyUG-0005Zz-Op for bug-gnu-emacs@gnu.org; Thu, 18 Aug 2011 05:02:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QtyWA-0001kH-Ea; Thu, 18 Aug 2011 05:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kazuhiro Ito Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Aug 2011 09:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9318 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13136582296688 (code B ref -1); Thu, 18 Aug 2011 09:04:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Aug 2011 09:03:49 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QtyVv-0001jo-C0 for submit@debbugs.gnu.org; Thu, 18 Aug 2011 05:03:48 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QtyVq-0001je-KB for submit@debbugs.gnu.org; Thu, 18 Aug 2011 05:03:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QtyTv-0005GU-GV for submit@debbugs.gnu.org; Thu, 18 Aug 2011 05:01:44 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:46965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtyTv-0005GF-Ez for submit@debbugs.gnu.org; Thu, 18 Aug 2011 05:01:43 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtyTu-0005CU-Ax for bug-gnu-emacs@gnu.org; Thu, 18 Aug 2011 05:01:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QtyTt-00059u-4d for bug-gnu-emacs@gnu.org; Thu, 18 Aug 2011 05:01:42 -0400 Original-Received: from msa102.auone-net.jp ([61.117.18.162]:39596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtyTs-00058J-Ns for bug-gnu-emacs@gnu.org; Thu, 18 Aug 2011 05:01:40 -0400 Original-Received: from GUNGNIR.med.osaka-cu.ac.jp (121-87-117-132f1.nar1.eonet.ne.jp [121.87.117.132]) by msa102.auone-net.jp (au one net msa) with ESMTP id DC129360038; Thu, 18 Aug 2011 18:01:29 +0900 (JST) User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 EasyPG/1.0.0 Emacs/23.3.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 18 Aug 2011 05:04:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50123 Archived-At: When I start Emacs and evaluate the below code, unexpected result returns. (let ((func (lambda () (with-temp-buffer (mapc 'insert '(166 25339)) (encode-coding-region (point-min) (point-max) 'ctext-unix) (buffer-string))))) (cons (funcall func) (funcall func))) -> ("=C2=A6=E6=8B=BB^@^@^@^@^@^@^@^@^@^@" . "^[$(D\"C^[$(H*f^[(B")=20 car of the result is not constant. In the worst case, emacs crashes. It doesn't occur on Linux. If I evaluate twice, car and cdr of the last result are correct. Using encode-coding-string instead of encode-coding-region has no problem.=20 (let ((func (lambda () (encode-coding-string (mapconcat 'char-to-string '(166 25339) "") 'ctext-unix)))) (cons (funcall func) (funcall func))) -> ("^[$(D\"C^[$(H*f^[(B" . "^[$(D\"C^[$(H*f^[(B") Before calling encode-coding-string also can avoid problem. (let ((func (lambda () (with-temp-buffer (mapc 'insert '(166 25339)) (encode-coding-region (point-min) (point-max) 'ctext-unix) (buffer-string))))) (encode-coding-string (mapconcat 'char-to-string '(166 25339) "") 'ctext-unix) (cons (funcall func) (funcall func))) -> ("^[$(D\"C^[$(H*f^[(B" . "^[$(D\"C^[$(H*f^[(B") --=20 Kazuhiro Ito