[Mimedefang] MIME::Entity not handling Charset => 'utf-8' correctly?

David F. Skoll dfs at roaringpenguin.com
Wed Feb 20 20:21:49 EST 2013


On Wed, 20 Feb 2013 17:20:25 -0700
Philip Prindeville <philipp_subx at redfish-solutions.com> wrote:

> utf8::upgrade($string);

UTF-8 handling in Perl is tricky.  If you use utf8::upgrade, it is almost
certainly a bug.  I have never encountered a situation in which utf8::upgrade
was appropriate.

Try putting "use Encode;" near the top of your test file and replacing

   utf8::upgrade($string);

with:

   $string = Encode::decode('utf-8', $string);

When I did that, the resulting output was:

<html>
Ellipsis=E2=80=A6
</html>

Now study the Encode man page very carefully...

Regards,

David.



More information about the MIMEDefang mailing list