From: Phrogz Date: 2006-11-10T15:23:47+09:00 Subject: Re: Trying to get pack to work with the * template character John Hahn wrote: > @image_array = Array.new > @image = File.open("test.JPG", "rb") do |image| > image.each_byte{|ch| @image_array << ch.to_s} > end > @temp = @image_array.pack("m*") I know very little about #pack, so I can't help you there. However, I can offer a slightly more terse (faster?) way to get the same array of strings: # Treat strings as one byte per char ascii $KCODE='a' File.open( "test.JPG", "rb" ) do |image| @image_array = image.read.split('').map{ |ch| ch[0].to_s } end