develooper Front page | perl.beginners | Postings from February 2009

Re: Help With Filtering Messages

Thread Previous | Thread Next
From:
Jeff Peng
Date:
February 8, 2009 21:53
Subject:
Re: Help With Filtering Messages
Message ID:
e1f459290902082153n4ba77b35u9f8e777a7d07bd33@mail.gmail.com
2009/2/9  <Jimstone77@aol.com>:
> I know there is probably a simple solution for this, but can anyone help me
> with code to filter out messages with extended characters like these:
>
> àïåëüñèí
> êàïèëêà
> òàáëåòêè
> ïåðåêèñü
> òåëåôîí
> òåòðàäè
> êàðàíäàøè
> îá¸ðòêè  îò êàíôåò
> êîðîáêà îò òåëåôîíà
> âàòà
> âàçà
> äèñêè
> êíèãè è  òåòðàäè
> È åùå êó÷à áóìàæåê è âñÿêîãî õëàìà
>
> Just something to dump any messages with these characters. Is there a  simple
> way?
>


Just by guess to decode them to utf8 since you didn't know which way
they are encoded. :-)

use Encode;
my @list = Encode->encodings(":all");  # get all encoding ways

for my $encoding (@list) {
    print "decoded with $encoding:\n";
    print encode("utf8",decode($encoding,$your_string) );
}


-- 
Jeff Peng
Office: +86-20-38350822
AIM: jeffpang
www.dtonenetworks.com

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About