use HTML::Entities; my $string = "String für Umwandlung"; print encode_entities( $string );