Perl 5.8.8 had no problem storing strings of Unicode chars. (The same string storage format is still used today in 5.18.)
Perl 5.8.8 had no problems encoding strings of Unicode chars to UTF-8. (A newer version of Encode than the one included with 5.18 is found on CPAN, and I bet it installs perfectly fine on 5.8.8.)
HTML::Entities's encode_entities
will encode the code points you want into entities, using named entities when they exist and numbered entities otherwise.