From: Michael Selig Date: 2008-09-16T15:20:59+09:00 Subject: [ruby-core:18617] IO limit - bytes or characters? Hi, Before getting to the main subject, there is a minor issue with the doc on IO#readbyte. I think it should say: "Reads a byte as with IO#getbyte" Several methods in IO take an option "limit" - gets/each_line etc. I thought, because these methods are based on a "line", that "limit" would be "maximum number of characters". However, it seems to be bytes, but it seems to be rounded up to the nearest whole character. At least it doesn't seem to split up multi-byte characters. Is this the intended behaviour? The documentation is rather vague: "the returning string would not be longer than the given value", but this sounds like it means number of characters. So may I suggest that either the behaviour be changed to mean "number of characters" (preferable), or the documentation explain what it does on multi-byte character encodings. This is low priority - I have never used the "limit" parameter myself, and I am not exactly sure what its use is, unless perhaps you expect very long lines in your input. Cheers Mike