From: Michael Morin Date: 2008-08-18T21:13:58+09:00 Subject: Re: unescaping html Vivek wrote: > Hi, > Is there a method or any library which allows me to unescape encoded > html. For example If I have hi%5Bthere%5D > I should get hi[there] > > vivek > I believe you're looking for the CGI::unescape method. If for some reason you don't have that, you can do a simple gsub like this, though it can fail in many ways and only handles hex entities. gsub(/%([[:xdigit:]]{2})/) {|c| $1.hex.chr } -- Michael Morin Guide to Ruby http://ruby.about.com/ Become an About.com Guide: beaguide.about.com About.com is part of the New York Times Company