From: Wakou Aoyama Date: 2001-09-07T07:21:51+09:00 Subject: [ruby-talk:20963] Re: BUG(!) in unescapeHTML On Thu, Aug 16, 2001 at 03:33:23PM +0900, Joseph Benik wrote: > require 'cgi' > txt=CGI::unescapeHTML(' ') > > results for me: > /cygdrive/c/RUBY/lib/ruby/1.6/cgi.rb:302:in `unescapeHTML': undefined > method `[]' for nil (NameError) > from /cygdrive/c/RUBY/lib/ruby/1.6/cgi.rb:274:in `gsub' > from /cygdrive/c/RUBY/lib/ruby/1.6/cgi.rb:274:in `unescapeHTML' > from test.rb:3 $ cat test.rb require 'cgi' puts CGI::REVISION txt=CGI::unescapeHTML(' ') p txt $ ruby-1.6.4 -vw test.rb ruby 1.6.4 (2001-06-04) [i586-linux] $Id: cgi.rb,v 1.23.2.5 2001/04/17 19:41:49 wakou Exp $ " " no NameError. What is version of ruby and cgi.rb which you use? > logical fix is to add > when /\Anbsp\z/ni then ' ' > > to the case statement on line 277, but this same error will crop up > for any other ampersand case the statement is unprepared for... which > seems like a flawed way of doing things. perhaps the logic around > line 302 could be re-worked. not bug. http://www.w3.org/TR/REC-html40/sgml/entities.html > U+00A0 ISOnum --> " " is not printable, and is not ' '. therefore; cgi.rb is doesn't converet. -- Wakou Aoyama