Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, folks:

I have a problem with utf8 (encoding|decoding) used with my send_email code. Basically the email subject and body are from a <form /> element, so all the utf8 within these fields are show as HTML escaped format like &#20013;&#25991;&#27979;&#35797;. this is sent directly to my email account which I can not read.. Is there any Perl modules that I can change these HTML entities to the original utf8 and then read from the email client normally(instead of &#20013; things)

BTW. I am using Net::SMTP to send the email..

Many thanks

  • Comment on Question about Encode utf8 within email

Replies are listed 'Best First'.
Re: Question about Encode utf8 within email
by GrandFather (Saint) on Nov 06, 2007 at 00:03 UTC

    HTML::Entities may be what you are looking for: HTML::Entities - Encode or decode strings with HTML entities.


    Perl is environmentally friendly - it saves trees
Re: Question about Encode utf8 within email
by Anonymous Monk on Nov 06, 2007 at 08:44 UTC
    You get these HTML entities because the browser uses them as a fallback. Very probably, you forgot to indicate the charset for your HTML form, or at least didn't use a Unicode charset. Typically, the browser uses the same charset (encoding) for sending data, as was used for receiving.