From: "Kroeger, Simon (ext)" Date: 2006-03-08T19:07:46+09:00 Subject: Re: from Hex to string p "66726f6d 70736e20".scan(/\w\w/).inject('') {|s, b| s << b.hex.chr} => "frompsn " cheers Simon > -----Original Message----- > From: Une b�vue [mailto:pere.noel@laponie.com.invalid] > Sent: Wednesday, March 08, 2006 10:14 AM > To: ruby-talk ML > Subject: from Hex to string > > i have datas like that : > > 646c6532 00000000 61657674 0000012e 00000000 00000000 > 0000011c 00000004 > 00000001 00000000 00000000 00000000 [...] > 6c6f6e67 00000004 00000000 66726f6d 70736e20 00000008 > 00000000 005c0001 > 3b3b3b3b 2d2d2d2d 54455854 00000006 626d6b6d 3a76 > > > seems to be hex encoded US-ASCII (?) > > how to convert that in user readable us-ascii ? (to string) > > i now i have the sequence "70736e20" which is "psn " > -- > une b�vue > >