use MIME::Words qw(encode_mimewords); print encode_mimewords("Me and \xABFran\xE7ois\xBB in town");