Project

General

Profile

Actions

Bug #8255

closed

File#each_line omits last byte (==\0) if encoding is utf-16

Added by arton (Akio Tajima) about 11 years ago. Updated about 11 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 2.1.0dev (2013-04-11) [i386-mswin32_100]
Backport:
[ruby-core:54177]

Description

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.


Files

test_utf16.rb (746 Bytes) test_utf16.rb arton (Akio Tajima), 04/11/2013 10:11 PM
test_utf16.rb (643 Bytes) test_utf16.rb arton (Akio Tajima), 04/12/2013 01:15 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0