12 'control!' => \
$unsafe_control,
13 'meta!' => \
$unsafe_meta,
14 'highbit!' => \
$unsafe_highbit,
15 ) or die "Usage: $0 [--[no-]control] [--[no-]meta] [--[no-]highbit]\n";
20 $unsafe_chars .= "\x00-\x08\x11\x12\x14-\x1F";
23 $unsafe_chars .= "><&\"'";
26 $unsafe_chars .= "\x7F-\x{FFFFFFFF}";
29 binmode STDIN
, ":utf8";
30 binmode STDOUT
, ":utf8";
33 print encode_entities
($_, $unsafe_chars);
42 htmlentities - Convert plain text into HTML-safe text
50 escape control chars (0x00-0x1F except TAB, LF, and CR)
54 escape meta chars (less-than, greater-than, ampersand, double- and single-quote)