From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.lisp.guile.user Subject: Re: guile 2.0.9 build on mingw Date: Mon, 17 Jun 2013 18:41:19 +0300 Message-ID: <83zjuosq1s.fsf@gnu.org> References: <83sj1hv2ml.fsf@gnu.org> <874ndx9y7h.fsf@pobox.com> <83ip2bt4qk.fsf@gnu.org> <8761xqhyyt.fsf@gnu.org> <83li6mt18y.fsf@gnu.org> <83wqq3mcq9.fsf@gnu.org> <87k3m3kor5.fsf@gnu.org> <83ehcalysu.fsf@gnu.org> <87sj0pvl4a.fsf@tines.lan> <837gi1n3v5.fsf@gnu.org> <87k3m1vg8b.fsf@tines.lan> <83txl4lhby.fsf@gnu.org> <838v2fky99.fsf@gnu.org> <83ip1iw2lu.fsf@gnu.org> <877ghu14qg.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1371483700 3259 80.91.229.3 (17 Jun 2013 15:41:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Jun 2013 15:41:40 +0000 (UTC) Cc: guile-user@gnu.org To: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jun 17 17:41:40 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UobYo-00061q-4a for guile-user@m.gmane.org; Mon, 17 Jun 2013 17:41:38 +0200 Original-Received: from localhost ([::1]:36342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UobYn-0000Q1-QI for guile-user@m.gmane.org; Mon, 17 Jun 2013 11:41:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UobYb-0000Pn-8v for guile-user@gnu.org; Mon, 17 Jun 2013 11:41:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UobYW-0003lB-7R for guile-user@gnu.org; Mon, 17 Jun 2013 11:41:25 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:40875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UobYV-0003l4-Vm; Mon, 17 Jun 2013 11:41:20 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MOJ00300NI6H000@a-mtaout21.012.net.il>; Mon, 17 Jun 2013 18:41:18 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MOJ003ZCNKTAI80@a-mtaout21.012.net.il>; Mon, 17 Jun 2013 18:41:17 +0300 (IDT) In-reply-to: <877ghu14qg.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10457 Archived-At: > From: ludo@gnu.org (Ludovic Court=E8s) > Cc: mhw@netris.org, guile-user@gnu.org > Date: Sun, 16 Jun 2013 16:59:19 +0200 >=20 > > Running ports.test > > FAIL: ports.test: file: binary mode ignores port encoding > > FAIL: ports.test: file: binary mode ignores file coding decl= aration > > > > Should I worry about this? >=20 > Possibly. :-) >=20 > Can you try this patch, run ./check-guile ports.test, and report th= e > debugging statements that are printed? That pk thing is a useful trick, thanks. Btw, is there documentation anywhere about how to use the GDB interface functions in Guile? I sometimes need to display Scheme values while debugging, and I see there are functions for that, but I found no description of how they are supposed to be used. What am I missing? > diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.t= est > index 9b1c6c0..6137181 100644 > --- a/test-suite/tests/ports.test > +++ b/test-suite/tests/ports.test > @@ -251,7 +251,7 @@ > (line (read-line in-port))) > (close-port in-port) > (delete-file filename) > - (string=3D? line binary-test-string))))) > + (string=3D? (pk 'line line) binary-test-string)= )))) > =20 > ;;; binary mode ignores file coding declaration > (pass-if "file: binary mode ignores file coding declaration" > @@ -272,7 +272,7 @@ > (line2 (read-line in-port))) > (close-port in-port) > (delete-file filename) > - (string=3D? line2 binary-test-string))))) > + (string=3D? (pk 'line2 line2) binary-test-strin= g))))) > =20 > ;; open-file ignores file coding declaration by default > (pass-if "file: open-file ignores coding declaration by default" It's due to the CRLF thing. These files are open in the "w" mode, bu= t then read using the "rb" mode. So the CR character is left after the newline is stripped, and botches the comparison. The debug lines you added show this (note the \r at the end): ;;; (line "\xe4\xb8\x80\xe4\xba\x8c\xe4\xb8\x89\r") FAIL: ports.test: file: binary mode ignores port encoding =20 ;;; (line2 "\xe4\xb8\x80\xe4\xba\x8c\xe4\xb8\x89\r") FAIL: ports.test: file: binary mode ignores file coding declarat= ion I think the solution is to attach to the output port a transcoder tha= t leaves the single newline character at end of line intact. But I couldn't find any example or documentation that would show me how to construct a transcoder for an encoding. make-transcoder wants a codec, but I see no documentation how to make one. IOW, how do I tak= e a string like "iso-8859-15" and make a codec out of it? I trust that you will know, though ;-) Thanks.