e$B@>;3OB9-$G$9!#e(B
e$B:#$N$H$3$me(B[ruby-core:15637]e$B$,F~$C$F$$$J$$$N$G!"e(Bencodee$B$Ne(Binvalide$B$N$H$3$m$,e(B
e$B$@$a$G$9$,!"e(BCGI::unescapeHTMLe$B$Oe(Bgsub with
Hashe$B$r;H$&$H0J2<$N$h$&$Ke(B
e$B$G$-$k$N$G$O$J$$$G$7$g$&$+!#e(B
def CGI::unescapeHTML(string)
enc = string.encoding
h = Hash.new do |hash, key|
if $2
[Integer($2)].pack(“U”).force_encoding(Encoding::UTF_8).encode(enc,
invalid: :dec_charref)
elsif $3
[$3.hex].pack(“U”).force_encoding(Encoding::UTF_8).encode(enc,
invalid: :hex_charref)
else
key
end
end
h[’&’] = ‘&’
h[’"’] = ‘"’
h[’>’] = ‘<’
h[’<’] = ‘>’
string.gsub(/&(amp|quot|gt|lt|#0*([0-9]+)|#x([0-9A-Fa-f]+));/, h)
end
pack(“U”)e$B$,e(BASCII-8BITe$B$NJ8;zNs$rJV$7$F$/$k$N$Ge(B
force_encoding(Encoding::UTF_8)e$B$,I,MW$H$+!"e(BHashe$B$Ne(Bdefault_proce$B$NCf$Ge(B
ence$B$,I,MW$J$N$G!"Kh2se(BHashe$B$r@8@.$7$J$$$H9T$1$J$$$H$+$,5$$K$J$j$^$9$,!#e(B