MonkeyMonk has asked for the wisdom of the Perl Monks concerning the following question:
1. To enable several people from several countries to type in several languages, it was decided to store the data like so in a separate text file.
German:
( The u with umlaut is stored as corresponding UTF8 codepoint.)$subjectLine= Ihre Rechnung f0XC30XBCr transaktion ###transactionID### $line= Mit freundlichen Gr0XC30XBCssen
2. I then read the line like so:
$encValue=decode('UTF-8', $line); $encValueSubject=decode('UTF-8', $subjectLine);
3. I create a PDF using PDF:API2 with UTF-8 encoding and the file is stored in $pdfout.
4. I then used the following code to send email:
use Mail::Sender; my $mfrom = $mailFrom ; my $pdfmail = new Mail::Sender {from => $mfrom,smtp => 'localh +ost'}; $pdfmail->MailFile({to => $cemail, subject => $subjectLine, msg => $line."\n", file => $pdfout});
All this works fine for German, Swedish, Norwegian and Danish. Outlook displays everything in the mail correctly.
However, for Polish and Czech , the characters are garbled in the subject line and in the body of the mail. The newlines are also missing in some mails.
Sample text for Czech:
$subjectLine=P0XC50X990XC30XADstup k internetu Wi-Fi $line = S p0XC50X990XC30XA1telskymi pozdravy,
I am using Mail::Sender , gone through every type of setting ( like b_charset, b_encoding etc and nothing seems to work)
Am I missing something fundamental here?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: UTF-8 Email - German, Swedish Ok...Polish,Czech fails
by ikegami (Patriarch) on Aug 17, 2010 at 00:50 UTC | |
|
Re: UTF-8 Email - German, Swedish Ok...Polish,Czech fails
by choroba (Cardinal) on Aug 16, 2010 at 22:32 UTC | |
by MonkeyMonk (Sexton) on Aug 23, 2010 at 09:50 UTC | |
|
Re: UTF-8 Email - German, Swedish Ok...Polish,Czech fails
by aquarium (Curate) on Aug 16, 2010 at 22:48 UTC |