fix error reporting in `reencode-input-port'
Closes PR 12076
This commit is contained in:
parent
73b16c8578
commit
e01ee43300
|
@ -1332,7 +1332,7 @@
|
|||
[newline-convert? #f]
|
||||
[decode-error (lambda (msg port)
|
||||
(error 'reencode-input-port
|
||||
(format "~a: ~e" msg)
|
||||
(format "~a: ~~e" msg)
|
||||
port))])
|
||||
(let ([c (let ([c (bytes-open-converter encoding "UTF-8")])
|
||||
(if newline-convert? (mcons c #f) c))]
|
||||
|
|
|
@ -722,6 +722,11 @@
|
|||
(test #\c read-char ei)
|
||||
(test eof read-char ei)))
|
||||
|
||||
(err/rt-test
|
||||
(port->bytes (reencode-input-port (open-input-bytes #"\xFF\xFF") "utf-8"))
|
||||
(lambda (exn)
|
||||
(regexp-match? #rx"^reencode-input-port:" (exn-message exn))))
|
||||
|
||||
;; --------------------------------------------------
|
||||
|
||||
(let-values ([(in out) (make-pipe)])
|
||||
|
|
Loading…
Reference in New Issue
Block a user