Project

General

Profile

Actions

Bug #3407

closed

Kernel.open Ignores 'BOM|' Prefix of :encoding Value

Added by runpaint (Run Paint Run Run) over 14 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.3dev (2010-06-01 trunk 28120) [i686-linux]
Backport:
[ruby-core:30641]

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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0