[MacRuby] #887: calling join on an Array of BINARY Strings returns UTF-8, may raise Encoding::CompatibilityError.

MacRuby ruby-noreply at macosforge.org
Thu Sep 9 03:20:57 PDT 2010


#887: calling join on an Array of BINARY Strings returns UTF-8, may raise
Encoding::CompatibilityError.
---------------------------------+------------------------------------------
 Reporter:  dev@…                |       Owner:  lsansonetti@…        
     Type:  defect               |      Status:  new                  
 Priority:  major                |   Milestone:                       
Component:  MacRuby              |    Keywords:                       
---------------------------------+------------------------------------------

Comment(by dev@…):

 That's not true.


 {{{
 #!/usr/bin/env ruby
 # encoding: UTF-8
 s = "a".force_encoding("BINARY")
 puts s.encoding
 puts [s, s].join.encoding
 s = "\xA4\x01".force_encoding("BINARY")
 puts s.encoding
 puts [s, s].join.encoding
 }}}

 Gives me

 {{{
 ASCII-8BIT
 ASCII-8BIT
 ASCII-8BIT
 ASCII-8BIT
 }}}

 With ruby 1.9.2p0 (2010-08-18 revision 29034)
 [universal.x86_64-darwin10.4.0]

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



More information about the macruby-tickets mailing list