Converted entities to their respective literals with the following Perlscript
#!/usr/bin/evn perl
use utf8;
use HTML::Entities;
binmode STDOUT, ":utf8";
@file = <>;
$file = join /\n/, @file;
for $i (0..length $file) {
if ( (substr($file, $i, 1) eq '&') and (substr($file, ($i+1), 1) eq '#') ) {
$eat = 1; # Yummie entities
undef $food;
next;
} elsif ($eat && substr($file, $i, 1) eq '#') {
next;
} elsif ($eat && substr($file, $i, 1) =~ /\d/) {
$food .= substr($file, $i, 1);
next;
} elsif ($eat && substr($file, $i, 1) =~ /;/) {
undef $eat;
$out .= chr($food);
undef $food;
next;
}
$out .= substr($file, $i, 1);
}
$out = decode_entities($out);
print $out;