From: Run Paint Run Run Date: 2010-06-08T09:56:17+09:00 Subject: [ruby-core:30647] [Bug #3407] Kernel.open Ignores 'BOM|' Prefix of :encoding Value Issue #3407 has been updated by Run Paint Run Run. I suppose so. It just seems to add more complexity to an already confusing process. The format of a mode string is: * 'a' or 'r' or 'w' * Optionally followed by '+' * Optionally followed by either 'b' or 't' * Optionally followed by a colon, an optional 'BOM|' (if the external encoding is Unicode, and ignoring the UTF-7 case), followed by an encoding name. * Optionally followed by another colon, then either another encoding name or hyphen. Then, the :encoding argument can take the value after the first colon in the mode string. The :internal_encoding argument can take the value after the second colon in the mode string. However, the :external_encoding argument takes the value between the two colons, but cannot have a 'BOM|' prefix. (Further, the rdoc (io.c:6363) claims that, w.r.t. :external_encoding, '-' is a synonym for Encoding.default_external, but this value raises an ArgumentError). It's a lot to explain. The fewer special cases, the better, IMHO. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/3407 ---------------------------------------- http://redmine.ruby-lang.org