in reply to Unicode to HTML code &#....;

I cannot reproduce that:
my $n = "\x78\x54\xC5\x99\xD8\xB9\xD0\xBC\xD8\xB9\x2E\x20\xE1\xB8\xA0\ +x7C\x20\x7 B\xC4\xA2\x6C\xC3\xA2\xC3\x90\xC3\xAE\xC3\xA2\x54\xC5"; my $m = $n; chop $m; say 'Decode error with \xC5' unless utf8::decode ($n); say 'Decode error without \xC5' unless utf8::decode ($m); say "With \\xC5: $n"; say "Without \\xC5: $m"; __END__
Decode error with \xC5
With \xC5: xTřعмع. Ḡ| {ĢlâÐîâTÅ
Without \xC5: xTřعмع. Ḡ| {ĢlâÐîâT

Note that with the trailing \xC5, utf8::decode detects an error.