#!/usr/bin/perl -w use strict; use Text::Iconv; use HTML::Entities; # create the conversion method (only once) my $conv = Text::Iconv->new("utf8", "latin1"); my $html_text = encode_entities( $conv->convert( $utf8_text));