unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-user@gnu.org
Subject: Re: guile 2.0.9 build on mingw
Date: Mon, 17 Jun 2013 18:41:19 +0300	[thread overview]
Message-ID: <83zjuosq1s.fsf@gnu.org> (raw)
In-Reply-To: <877ghu14qg.fsf@gnu.org>

> From: ludo@gnu.org (Ludovic Courtès)
> Cc: mhw@netris.org,  guile-user@gnu.org
> Date: Sun, 16 Jun 2013 16:59:19 +0200
> 
> >      Running ports.test
> >      FAIL: ports.test: file: binary mode ignores port encoding
> >      FAIL: ports.test: file: binary mode ignores file coding declaration
> >
> >    Should I worry about this?
> 
> Possibly.  :-)
> 
> Can you try this patch, run ./check-guile ports.test, and report the
> 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.test
> 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=? line binary-test-string)))))
> +                   (string=? (pk 'line line) binary-test-string)))))
>  
>  ;;; 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=? line2 binary-test-string)))))
> +                   (string=? (pk 'line2 line2) binary-test-string)))))
>  
>  ;; 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, but
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
     
     ;;; (line2 "\xe4\xb8\x80\xe4\xba\x8c\xe4\xb8\x89\r")
     FAIL: ports.test: file: binary mode ignores file coding declaration

I think the solution is to attach to the output port a transcoder that
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 take
a string like "iso-8859-15" and make a codec out of it?  I trust that
you will know, though ;-)

Thanks.




  reply	other threads:[~2013-06-17 15:41 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 19:46 guile 2.0.9 build on mingw Panicz Maciej Godek
2013-05-20 20:05 ` Eli Zaretskii
2013-05-20 20:46   ` Andy Wingo
2013-05-20 21:09     ` objc
2013-05-21  2:43       ` Eli Zaretskii
2013-05-22 15:26     ` Eli Zaretskii
2013-06-07  8:37       ` Eli Zaretskii
2013-06-07 12:44       ` Ludovic Courtès
2013-06-07 14:59         ` Eli Zaretskii
2013-06-09 17:10           ` Eli Zaretskii
2013-06-09 20:33             ` Ludovic Courtès
2013-06-09 21:16               ` Andy Wingo
2013-06-09 21:35                 ` Ludovic Courtès
2013-06-10 16:18                   ` Eli Zaretskii
2013-06-10 16:18                 ` Eli Zaretskii
2013-06-10 16:23               ` Eli Zaretskii
2013-06-10 19:09                 ` Mark H Weaver
2013-06-10 19:49                   ` Eli Zaretskii
2013-06-10 20:54                     ` Mark H Weaver
2013-06-11 16:53                       ` Eli Zaretskii
2013-06-11 22:11                         ` Ludovic Courtès
2013-06-12 17:46                           ` Eli Zaretskii
2013-06-18 21:51                             ` Why launch the Guile signal delivery thread on exit? (was Re: guile 2.0.9 build on mingw) Mark H Weaver
2013-06-19 15:51                               ` Eli Zaretskii
2013-06-19 16:06                               ` Julian Graham
2013-06-19 19:20                               ` Ludovic Courtès
2013-06-12 17:57                         ` guile 2.0.9 build on mingw Eli Zaretskii
2013-06-13 13:26                           ` Eli Zaretskii
2013-06-16 14:19                             ` Ludovic Courtès
2013-06-13 13:33                           ` Eli Zaretskii
2013-06-16 14:36                             ` Ludovic Courtès
2013-06-16 15:40                               ` Eli Zaretskii
2013-06-16 14:55                             ` Ludovic Courtès
2013-06-16 15:47                               ` Eli Zaretskii
2013-06-16 18:59                                 ` Ludovic Courtès
2013-06-13 13:40                           ` Eli Zaretskii
2013-06-16 14:59                             ` Ludovic Courtès
2013-06-17 15:41                               ` Eli Zaretskii [this message]
2013-06-18 20:45                                 ` Ludovic Courtès
2013-06-18 22:28                                   ` Mark H Weaver
2013-06-19  3:03                                     ` Eli Zaretskii
2013-06-19 19:26                                     ` Ludovic Courtès
2013-06-19 20:02                                       ` Eli Zaretskii
2013-06-19  2:59                                   ` Eli Zaretskii
2013-06-19 15:56                                   ` Eli Zaretskii
2013-06-19 19:38                                     ` Ludovic Courtès
2013-06-13 13:41                           ` Eli Zaretskii
2013-06-16 15:04                             ` Ludovic Courtès
2013-06-16 15:48                               ` Eli Zaretskii
2013-06-16 14:44                           ` Ludovic Courtès
2013-06-16 15:41                             ` Eli Zaretskii
2013-06-12 17:59                         ` Eli Zaretskii
2013-06-16 14:46                           ` Ludovic Courtès
2013-06-12 18:02                         ` Eli Zaretskii
2013-06-16 19:50                           ` Ludovic Courtès
2013-06-16 20:22                             ` Eli Zaretskii
2013-06-17 15:45                           ` Mark H Weaver
2013-06-18 17:17                             ` Eli Zaretskii
2013-06-18 19:31                               ` Eli Zaretskii
2013-06-18 20:19                                 ` Ludovic Courtès
2013-06-19  2:53                                   ` Eli Zaretskii
2013-06-19 19:28                                     ` Ludovic Courtès
2013-06-19 19:56                                       ` Eli Zaretskii
2013-05-26 20:41     ` Panicz Maciej Godek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zjuosq1s.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=guile-user@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).