# -*- coding: UTF-8 -*- # # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/12900 text = [] text << "\xE2\x98\xB9" text << [0x2639].pack('U') SOURCE = < \u2639 EOF require 'rexml/document' doc = REXML::Document.new(SOURCE) text << doc.root.elements[1].text text << doc.root.elements[2].text label = [ 'ruby literal', 'ruby pack', 'xml text', 'xml entity' ] puts '' puts 'Mixed hearts' puts '' puts '' puts '' puts '' puts '' puts '' text.length.times do |i| puts "" end puts '' puts '' text.length.times do |i| puts "" puts "" end puts '' text.length.times do |i| puts "" puts "" puts "" puts "" text.length.times do |j| begin puts "" puts "" rescue puts "" end end puts "" end puts "
sourceencodinglen+ #{label[i]}
encodinglen
#{label[i]}#{text[i].encoding}#{text[i].length}#{(text[i] + text[j]).encoding}#{(text[i] + text[j]).length}boom
" puts '' puts ''