From: "arton (Akio Tajima)" Date: 2013-04-11T22:11:54+09:00 Subject: [ruby-core:54177] [ruby-trunk - Bug #8255][Open] File#each_line omits last byte (==\0) if encoding is utf-16 Issue #8255 has been reported by arton (Akio Tajima). ---------------------------------------- Bug #8255: File#each_line omits last byte (==\0) if encoding is utf-16 https://bugs.ruby-lang.org/issues/8255 Author: arton (Akio Tajima) Status: Open Priority: Normal Assignee: Category: Target version: current: 2.1.0 ruby -v: ruby 2.1.0dev (2013-04-11) [i386-mswin32_100] If File#each_line was given utf-16 encoded file with 'rb:utf-16', each line lacks the last one byte. For example if the line is "a\0\r\0\n\0" in binary, the read line contains "a\0\r\0\r". See the attchement. This issue is appear both current 2.1.0 and 2.0.0. -- http://bugs.ruby-lang.org/