From: botp Date: 2012-07-22T12:00:39+09:00 Subject: Re: hex string to bytestring On Sun, Jul 22, 2012 at 10:42 AM, Matt Neuburg wrote: > s = "0x0253000c" > output = "" > s = s[2..-1] > s.split(//).each_slice(2) do |ss| > output << ss.join.hex.chr > end > p output # => "\002S\000\f" > > Great, but this seems idiotic. well, i dont find that "idiotic" so to speak... but try this eg, ["0253000C"].pack "H*" => "\x02S\x00\f" kind regards -botp