From: Brian Candler Date: 2010-09-08T20:15:31+09:00 Subject: Re: Regex breaks when string contains binary data Aisha Fenton wrote: > Hi Brian, > Output those IRB statements for me is: ... >> RUBY_DESCRIPTION => "ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]" ... >>> "\345HI" =~ /HI|BYE/ > => nil >>> "\345HI".bytes.to_a > => [229, 72, 73] Hmm. What does $KCODE show? I can reproduce your problem if I turn it on. $ irb --simple-prompt >> "\345HI" =~ /HI|BYE/ => 1 >> $KCODE => "NONE" $ irb -Ku --simple-prompt >> "\345HI" =~ /HI|BYE/ => nil >> "345HI" =~ /HI|BYE/ => 3 >> $KCODE => "UTF8" Do you have something in RUBYOPT environment variable? (echo $RUBYOPT) -- Posted via http://www.ruby-forum.com/.