From: "Iñaki Baz Castillo" Date: 2011-04-21T19:52:49+09:00 Subject: Re: splitting binary data 2011/4/20 7stud -- : > str = "\xFF\xFF" + >      "\x61" + >      "\xFF\xFF" + >      "\x62" + >      "\xFF\xFF" + >      "\x63" + >      "\xFF\xFF" + >      "\x64" > > pattern = "\xFF\xFF" > p str.split(pattern) > > --output:-- > ["", "a", "b", "c", "d"] Note that this fails under Ruby1.9: p str.split(pattern) ArgumentError: invalid byte sequence in UTF-8 from (irb):10:in `split' -- Iñaki Baz Castillo