For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > April 2004 > EMAIL: Extended Characters in SUBJECT field









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author EMAIL: Extended Characters in SUBJECT field
Sean O'Dwyer

2004-04-28, 1:38 am

Using this code, as I've used for ages in many scripts, causes an error
on a Spanish language site I'm devloping.

print MAIL "MIME-Version: 1.0\n";
print MAIL "Content-type: text/plain; charset=iso-8859-1\n";
print MAIL "Content-transfer-encoding: quoted-printable\n";
print MAIL "Subject: Confirmacion\n\n";

"Confirmacion" should have an accent over the second "o" but my
newsreader won't let me type the character directly.

The error is that sendmail sends the e-mail correctly, but the recipient
sees the subject messily formatted as...

Subject: =?UNKNOWN?Q?Confirmaci=F3n?=

How can I encode this character properly in the script, so the accent
appears over the "o"?

(The Perl source file is uploaded as ISO Western Latin 1.)

Thanks in advance,

Sean
Villy Kruse

2004-04-28, 4:33 am

On Wed, 28 Apr 2004 04:44:15 GMT,
Sean O'Dwyer <nospam@spamfree.dud> wrote:


> Using this code, as I've used for ages in many scripts, causes an error
> on a Spanish language site I'm devloping.
>
> print MAIL "MIME-Version: 1.0\n";
> print MAIL "Content-type: text/plain; charset=iso-8859-1\n";
> print MAIL "Content-transfer-encoding: quoted-printable\n";
> print MAIL "Subject: Confirmacion\n\n";
>
> "Confirmacion" should have an accent over the second "o" but my
> newsreader won't let me type the character directly.
>
> The error is that sendmail sends the e-mail correctly, but the recipient
> sees the subject messily formatted as...
>
> Subject: =?UNKNOWN?Q?Confirmaci=F3n?=
>


The rfc2047 document tells you all about it. The text "UNKNOWN" should
have been "iso-8859-1" and the receiver would be very happy.

Villy
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com