#!/usr/bin/perl use strict; use warnings; use HTML::Entities; my $line = "This is a test of \xe2\x80\x9cquotes\xe2\x80\x9d\n"; print encode_entities($line, "\200-\377"); # looking for “ ” in the output print $line; #### This is a test of “quotes” This is a test of “quotes” #### This is a test of “quotes” This is a test of “quotes”