From: Tanaka Akira Date: 2010-02-26T19:42:30+09:00 Subject: [ruby-dev:40494] Re: [Bug:trunk] readpartial after ungetc fails with text mode 2010年2月26日19:34 Yusuke ENDOH : > 1. text mode だと ungetc が rbuf でなく cbuf に記録する > 2. readpartial は rbuf しか見ない > > readpartial が cbuf も見るべきなんですかね。 いいえ。 cbuf は文字コード変換済みのデータを貯めておく場所であり、 readpartial は変換前のバイト列を読み出すメソッドなので、 cbuf を読まないのは正しい動作です。 cbuf が空でなければ例外にするという選択肢はありえます。 -- [田中 哲][たなか あきら][Tanaka Akira]