From: Tom Werner Date: 2007-08-17T05:27:48+09:00 Subject: Re: character to hex/binary/etc... John Joyce wrote: > Hmm... I can turn a number into a character with .chr > I can convert my numbers with .to_s(2) ((where 2 is a radix, or base)) > But how do I convert numbers to characters?? > > You may be looking for Array#pack. It's useful for converting an array from one encoding to another. One of these possibilities is to convert an array of numbers into a string: n = [65, 66, 67] n.pack("c*") #=> "ABC" Pack (and unpack) can do tons of useful and surprising things. Tom -- * Libraries: Chronic (chronic.rubyforge.org) God (god.rubyforge.org) * Site: rubyisawesome.com