[MacRuby] #838: Assertion fails when use the String converted into "utf-16le".

MacRuby ruby-noreply at macosforge.org
Mon Aug 9 19:38:30 PDT 2010


#838: Assertion fails when use the String converted into "utf-16le".
----------------------------------+-----------------------------------------
 Reporter:  watson1978@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  blocker               |   Milestone:                       
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 Test Script:
 {{{
 #!ruby
 $ cat test_encode.rb
 begin
   "ff".encode("utf-16le").hex
   p "ng"
 rescue => e
   p e
 end

 begin
   "ff".encode("utf-16be").hex
   p "ng"
 rescue => e
   p e
 end
 }}}

 Result of Ruby 1.9.1:
 {{{
 $ ruby test_encode.rb
 #<Encoding::CompatibilityError: ASCII incompatible encoding: UTF-16LE>
 #<Encoding::CompatibilityError: ASCII incompatible encoding: UTF-16BE>
 }}}

 Result of MacRuby Trunk:
 {{{
 $ macruby test_encode.rb
 Assertion failed: (!str_is_stored_in_uchars(self)), function
 str_ensure_null_terminator, file string.c, line 720.
 zsh: abort      macruby test_encode.rb
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/838>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list