From: Tony Sloane Date: 2002-10-08T09:36:13+09:00 Subject: Problem with pack and Hh format specifiers Hi, I'm relatively new to Ruby so perhaps I'm missing something, but I can't get Array's pack to work in the following situation: irb(main):001:0> "%08b" % ["4","7"].pack ('HXh')[0] "00000111" I'm expecting to see "01000111". Note that unpack seems to work the way I would expect. (ASCII code for 'G' is 01000111.) irb(main):002:0> "G".unpack ('HXh') ["4", "7"] Can anyone shed any light on this? I'm using Ruby 1.6.7 on a (mostly) Debian Woody linux system. Thanks in advance, Tony Sloane Dept of Computing Macquarie University