GNU bug report logs - #22901
drain-input doesn't decode

Previous Next

Package: guile;

Reported by: Zefram <zefram <at> fysh.org>

Date: Fri, 4 Mar 2016 03:11:01 UTC

Severity: normal

Done: Taylan Kammer <taylan.kammer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Matt Wette <matt.wette <at> gmail.com>
To: 22901 <at> debbugs.gnu.org
Subject: bug#22901: drain-input doesn't decode
Date: Sun, 26 Feb 2017 09:46:14 -0800
[Message part 1 (text/plain, inline)]
I put together a test and tried on 2.1.7 - my test fails.  See attached.

  (pass-if "encoded input"
    (let ((fn (test-file))
	  (nc "utf-8")
	  (st "\u03b2\u03b1\u03b4 \u03b1\u03c3\u03c3 am I.")
	  ;;(st "hello, world\n")
	  )
      (let ((p1 (open-output-file fn #:encoding nc)))
	;;(display st p1)
	(string-for-each (lambda (ch) (write-char ch p1)) st)
	(close p1))
      (let* ((p0 (open-input-file fn #:encoding nc))
	     (s0 (begin (unread-char (read-char p0) p0) (drain-input p0))))
	(simple-format #t "~S\n" s0)
	(equal? s0 st))))

[port-di.test (application/octet-stream, attachment)]

This bug report was last modified 4 years ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.