From: nobu@... Date: 2019-08-13T14:22:29+00:00 Subject: [ruby-core:94326] [Ruby master Bug#16099] UTF-16LE BOM followed by '\0' is missed 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)' # ``` The last result must be UTF-16LE. -- https://bugs.ruby-lang.org/ Unsubscribe: