[EMAIL PROTECTED] [a], on Monday, May 23, 2005 at 05:12 (UT) wrote: a> typical filename in mail message looks like a> my $name="=?UTF-8?B?0L8xX9C80LXRgdGP0YfQvdCw0Y8ucnRm?="; a> i need to convert this to utf8 and then to cp1251 a> How precisely to do this ?
I think you have to decode this via MIME, and after to cp1251. But some characters aren't in 1251, so I use something different: use Unicode::Normalize; #decode here via MIME to utf-8 $string = acc($utf8); sub acc { (my $str = NFD(decode("utf8", shift))) =~ s/\pM//og; return $str; } -- thank you! all characters are in 1251 so here is snippet: ====== use Encode; #decode here via MIME to utf-8 use MIME::Base64; my $name="0L8xX9C80LXRgdGP0YfQvdCw0Y8ucnRm"; my $utf8=decode_base64($name); my $x1=decode("utf8",$utf8); my $x2=encode('cp-1251',$x1); print "x2=$x2\n"; # file name in x2 ====== i missed my $x1=decode("utf8",$utf8); _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs