Counts the number of lines correctly for files with certain multibyte encodings
Makes sure we do not fail if encoding == nil

It looks like it's valid to call this method even if `binary?` is true.
Encoding as 'ASCII-8BIT' should always succeed.
Takes a different approach
Merge pull request #1211 from alindeman/multibyte_line_count

Counts the number of lines correctly for files with certain multibyte encodings