JRuby support for reading from other encodings seems to be broken
Count newline characters in the buffer's own encoding