13 'ascii' => 'US-ascii',
14 'cyrillic' => 'iso-8859-5',
15 'arabic' => 'iso-8859-6',
16 'greek' => 'iso-8859-7',
17 'hebrew' => 'iso-8859-8',
18 'thai' => 'iso-8859-11',
19 'tis620' => 'iso-8859-11',
20 'ja_JP.euc' => 'euc-jp',
21 'x-euc-jp' => 'euc-jp',
22 'zh_CN.euc' => 'euc-cn',
23 'x-euc-cn' => 'euc-cn',
24 'ko_KR.euc' => 'euc-kr',
25 'x-euc-kr' => 'euc-kr',
27 'Shift_JIS' => 'shiftjis',
28 'x-sjis' => 'shiftjis',
31 'zh_TW.Big5' => 'big5',
32 'big5-hk' => 'big5-hkscs',
33 'WinLatin1' => 'cp1252',
34 'WinLatin2' => 'cp1250',
35 'WinCyrillic' => 'cp1251',
36 'WinGreek' => 'cp1253',
37 'WinTurkish' => 'cp1254',
38 'WinHebrew' => 'cp1255',
39 'WinArabic' => 'cp1256',
40 'WinBaltic' => 'cp1257',
41 'WinVietnamese' => 'cp1258',
44 for my $i (1..11,13..16){
45 $a2c{"ISO 8859 $i"} = "iso-8859-$i";
48 $a2c{"ISO Latin $i"} = "iso-8859-$Encode::Alias::Latin2iso[$i]";
50 for my $k (keys %Encode::Alias::Winlatin2cp){
51 my $v = $Encode::Alias::Winlatin2cp{$k};
52 $a2c{"Win" . ucfirst($k)} = "cp" . $v;
53 $a2c{"IBM-$v"} = "cp" . $v;
54 $a2c{"MS-$v"} = "cp" . $v;
58 use Test::More tests => (scalar keys %a2c) * 2;
60 print "# alias test\n";
62 foreach my $a (keys %a2c){
63 my $e = Encode::find_encoding($a);
64 is((defined($e) and $e->name), $a2c{$a});
67 # now we override some of the aliases and see if it works fine
69 Encode::define_alias( qr/shift.*jis$/i => '"macjapan"' );
70 Encode::define_alias( qr/sjis$/i => '"cp932"' );
72 @a2c{qw(Shift_JIS x-sjis)} = qw(macjapan cp932);
74 print "# alias test with alias overrides\n";
76 foreach my $a (keys %a2c){
77 my $e = Encode::find_encoding($a);
78 is((defined($e) and $e->name), $a2c{$a});
82 for (my $i = 0; $i < @Encode::Alias::Alias; $i+=2){
83 my ($k, $v) = @Encode::Alias::Alias[$i, $i+1];