summaryrefslogtreecommitdiff
path: root/regress/base/charset.pl
blob: f5d747a61ee9b4bbe70375863331818861aebc0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env perl
#
# $FML$
#

use Mail::Message::Charset;

use Mail::Message::Charset;
my $mc = new Mail::Message::Charset;



$subject = '=?ISO-2022-JP?B?GyRCOkc9Kko8NG8hRBsoQg==?=';

if ($subject =~ /=\?iso-2022-jp\?/i) {
    $in_code  = 'jis-jp';
    $out_code = 'euc-jp';
}

print "  in $in_code\n";
print " out $out_code\n";

if ($subject =~ /=\?([-\w\d]+)\?/i) {
    my $lang = $mc->message_charset_to_language($1);
    print "lang $lang\n";

    $in_code  = $mc->language_to_message_charset($lang);
    $out_code = $mc->language_to_internal_charset($lang);
}

print "  in $in_code\n";
print " out $out_code\n";

exit 0;