From: William James Date: 2005-09-13T09:51:33+09:00 Subject: Re: Adventures in html decoding. Simon Kr�ger wrote: > > [...] > > Which lead to... > > > > === > > require 'cgi' > > outfile = File.new(ARGV[1], File::CREAT|File::WRONLY|File::EXCL) > > IO.readlines(ARGV[0]).each{ |line| > > outfile.puts CGI::unescapeHTML(line) > > } > > outfile.close > > === > > > > Which is much simpler; just some file handling stuff around > > the unescapeHTML function. Maybe later I'll try something with > > rubywebdialogs that'll let me paste into a web browser window > > and get back results the way I'd like to be able to do... > > > > The moral of this story is, html obfuscation sucks. > > > > (What? That's *not* the moral? Oh well...) > > > > -Morgan > > the moral is, there is always a simpler way :) > > require 'cgi' > open(ARGV[1], 'w') do |f| > f.write(CGI::unescapeHTML(IO.read(ARGV[0]))) > end > > cheers > > Simon Simpler still: require 'cgi' open(ARGV.pop, 'w') { |f| f.write(CGI.unescapeHTML(ARGF.read)) }