fix error reporting in `reencode-output-port'

Closes PR 12077
This commit is contained in:
Eli Barzilay 2011-07-25 23:46:16 -04:00
parent eba9c56d8c
commit 61f628f2c6
2 changed files with 7 additions and 2 deletions

View File

@ -1469,7 +1469,7 @@
[convert-newlines-to #f]
[decode-error (lambda (msg port)
(error 'reencode-input-port
(format "~a: ~e" msg)
(format "~a: ~~e" msg)
port))])
(let ([c (bytes-open-converter "UTF-8" encoding)]
[ready-bytes (make-bytes 1024)]

View File

@ -726,7 +726,12 @@
(port->bytes (reencode-input-port (open-input-bytes #"\xFF\xFF") "utf-8"))
(lambda (exn)
(regexp-match? #rx"^reencode-input-port:" (exn-message exn))))
(err/rt-test
(let ([o (reencode-output-port (open-output-bytes) "utf-8")])
(display #"\xFF\xFF" o) (flush-output o))
(lambda (exn)
(regexp-match? #rx"^reencode-output-port:" (exn-message exn))))
;; --------------------------------------------------
(let-values ([(in out) (make-pipe)])