[MacRuby] #906: Double BOM force_encoding bug (from HAML)

MacRuby ruby-noreply at macosforge.org
Sun Dec 5 14:46:54 PST 2010


#906: Double BOM force_encoding bug (from HAML)
---------------------------------+------------------------------------------
 Reporter:  timmfin@…            |       Owner:  vincent.isambart@…        
     Type:  defect               |      Status:  new                       
 Priority:  major                |   Milestone:                            
Component:  MacRuby              |    Keywords:                            
---------------------------------+------------------------------------------

Comment(by vincent.isambart@…):

 The reason no exception is thrown for the single BOM is that there is no
 character before it in the first string. Even with a single BOM, if there
 is a character before in the dynamic string you get an error:
 {{{
 % macruby -e '"#{"\uFEFF".encode("UTF-8").force_encoding("BINARY")}"'
 % macruby -e '"a#{"\uFEFF".encode("UTF-8").force_encoding("BINARY")}"'
 -e:1:in `<main>': incompatible character encodings: UTF-8 and ASCII-8BIT
 (Encoding::CompatibilityError)
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/906#comment:4>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list