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

i have a perl script piped to an email in the script i need to read the email and do some processing i want to know what will be the encoding if i extract some numbers from the email and store in a variable

Replies are listed 'Best First'.
Re: Help in finding encoding
by ikegami (Patriarch) on Jun 28, 2011 at 08:15 UTC

    It should be specified in the Content-Type for both text/plain and text/html.

    Content-Type: text/plain; charset="us-ascii" Content-Type: text/plain; charset=UTF-8 etc

    If it's not, you have to guess.

Re: Help in finding encoding
by Anonymous Monk on Jun 28, 2011 at 07:58 UTC

    i have a perl script piped to an email in the script i need to read the email and do some processing i want to know what will be the encoding if i extract some numbers from the email and store in a variable

    There will be no encoding, you will have bytes (or "octets")

    Now, whether or not you can decode those octets as UTF... depends entirely on those other programs, not perl