This project is closed and read-only.
Actions
Bug #912
closedConfusion over encoding returned by IO#read & IO.read
Bug #912:
Confusion over encoding returned by IO#read & IO.read
Status:
Rejected
Assignee:
Description
=begin
I find it confusing that IO#read & IO.read return an ASCII-8BIT string when a length is specified, but not when the entire file is read (no length specified).
Given that we have "binread" to read binary data, why not make "read(length)" work like gets("", length) so it consistently returns the encoding?
=end
Updated by shyouhei (Shyouhei Urabe) over 17 years ago
- Assignee set to matz (Yukihiro Matsumoto)
- ruby -v set to 1.9.1
=begin
=end
Updated by naruse (Yui NARUSE) over 16 years ago
- Status changed from Open to Rejected
=begin
It is intended.
IO#read(bytesize) / IO.read(bytesize) is binary method.
So its argument is bytesize and it specify ASCII-8BIT.
If you want a read character method, Feature #908 is related ticket.
=end
Actions