[ruby-core:94326] [Ruby master Bug#16099] UTF-16LE BOM followed by '\0' is missed

From: nobu@...
Date: 2019-08-13 14:22:29 UTC
List: ruby-core #94326
Issue #16099 has been reported by nobu (Nobuyoshi Nakada).

----------------------------------------
Bug #16099: UTF-16LE BOM followed by '\0' is missed
https://bugs.ruby-lang.org/issues/16099

* Author: nobu (Nobuyoshi Nakada)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Target version: 
* ruby -v: 
* Backport: 2.5: REQUIRED, 2.6: REQUIRED
----------------------------------------
```
$ 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.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next