Antonio Lobato wrote:
I wrote a perl for get mail messages from postfix smtp server via
STDIN.
My problem is postfix is sending encoded characters to my script.
If it have to send a acentued "a", á, it sends a

            =?ISO-8859-1?B?4SDjIOI=?=

instead. for acentued "e", é, it sends the string

            =?ISO-8859-1?B?6SDq?=

How to get perl convert between such encoded string and the right
acentued char?

use MIME::Base64; my $string = '=?ISO-8859-1?B?4SDjIOI=?='; my ($encoded) = $string =~ /=\?[^?]+\?B\?([^?]+)\?=/; print decode_base64($encoded), "\n";

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to