# TODO: turn this into a REAL diff # what we did: we added the line with @ stuff # replace invalid utf8 character with SUBSTITUTION sequence sub esc_html { my $str = shift; my %opts = @_; return undef unless defined $str; $str = to_utf8($str); $str = $cgi->escapeHTML($str); $str =~ s/@/@/g; if ($opts{'-nbsp'}) { $str =~ s/ / /g; } $str =~ s|([[:cntrl:]])|(($1 ne "\t") ? quot_cec($1) : $1)|eg; return $str; }