>>>>> "D" == David Alan Black <dblack / candle.superlink.net> writes: D> On Mon, 17 Dec 2001, Thaddeus L. Olczyk wrote: >> For the truely intelligent who try this, thanks. Personnaly, I'm really stupid D> I take it that you MUST use String#each_byte, so here: Well it exist always a possibility to write stupid thing :-)) D> str.each_byte {|b| [...] D> } str = "hello 123 I am a String" str.gsub!(/./m) do |b| case b when /[[:lower:]]/ "\\x" + "%x" % b[0] # this is % that you want ? else b end end p str Guy Decoux