Project

General

Profile

Actions

Bug #16099

closed

UTF-16LE BOM followed by '\0' is missed

Added by nobu (Nobuyoshi Nakada) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Target version:
-
ruby -v:
[ruby-core:94326]

Description

$ ruby -e 'File.binwrite("u.txt", "\xff\xfe\x00\x01")'
$ file u.txt 
u.txt: Little-endian UTF-16 Unicode text, with no line terminators
$ ruby -e 'p File.open("u.txt", "rb:bom|utf-8", &:external_encoding)'
#<Encoding:UTF-8>

The last result must be UTF-16LE.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0