Actions
Bug #3407
closedKernel.open Ignores 'BOM|' Prefix of :encoding Value
Description
=begin
As reported in [ruby-core:30603]:
open('/tmp/bom', mode: ?w){|f| f << "\xEF\xBB\xBFfoo"}
[*open('/tmp/bom', encoding: 'BOM|utf-8').read.bytes]
=> [239, 187, 191, 102, 111, 111]
[*open('/tmp/bom', mode: 'r:BOM|utf-8').read.bytes]
=> [102, 111, 111]
[*open('/tmp/bom', 'r:BOM|utf-8').read.bytes]
=> [102, 111, 111]
=end
Actions
Like0
Like0Like0Like0Like0