From: Abhijit Gadgil Date: 2007-04-14T01:01:03+09:00 Subject: Re: Converting hex or dec to ascii ? On 4/13/07, mrpink wrote:> Hi,> I have a variable like:>> test = 0x65 0x78>> and I wanna have this converted or outputet to-----> ex>> which is the ascii code of 0x65 (=e) and 0x78 (=x) . But how can I do> this ?>> test = 0x65 doesn't, test = "0x65" doesn't test = String(0x65) also> doesn't... If you have this in an array, you can use Array#pack eg. a = [0x65, 0x78].a.pack("U*") This will work for multibyte unicode strings as well. Hth. -- अभिजीत [written in http://www.paahijen.com/scratchpad] [http://www.paahijen.com]