Gauche scheme interpreter, version 0.8.3 [utf-8,pthreads]
という環境で、
#!/usr/bin/gosh
(define (main args)
  (while (not (eof-object? (set! line (read-line))))
  (print line))
  0)
というスクリプトを書いて euc-jp なテキストファイルを読み込ませたら
~$ gosh test.scm <text.txt
*** READ-ERROR: Read error at "(stdin)":line 2: read-line: encountered illegal byte sequence: #*"\xc1\xcf\xc0\xa4\xb5\xad\t1\t1\t"
Stack Trace:
_______________________________________
  0 (read-line)
  At line 3 of "./test.scm"
  1 (letrec ((do (lambda () (if (not (not (eof-object? (set! line (rea ...
  [unknown location]
というエラーになりました。
euc-jpなままで読んでeuc-jpのまま書き出すにはどうすればいいのでしょうか?