119 |
'utf-32be' => \&_name_utf32be, |
'utf-32be' => \&_name_utf32be, |
120 |
); |
); |
121 |
|
|
122 |
|
my %_IsMimeText; |
123 |
|
for (qw( |
124 |
|
adobe-standard-encoding adobe-symbol-encoding |
125 |
|
big5 big5-eten big5-hkscs |
126 |
|
cp950 |
127 |
|
gbk gb18030 |
128 |
|
euc-jp euc-jisx0213 euc-kr euc-tw |
129 |
|
hp-roman8 |
130 |
|
hz-gb-2312 |
131 |
|
ibm437 |
132 |
|
iso-2022-cn iso-2022-cn-ext |
133 |
|
iso-2022-int-1 |
134 |
|
iso-2022-jp iso-2022-jp-1 iso-2022-jp-2 iso-2022-jp-3 |
135 |
|
iso-2022-kr |
136 |
|
iso-8859-1 iso-8859-2 iso-8859-3 |
137 |
|
iso-8859-4 iso-8859-5 iso-8859-6 |
138 |
|
iso-8859-7 iso-8859-8 iso-8859-9 |
139 |
|
iso-8859-10 iso-8859-12 iso-8859-13 |
140 |
|
iso-8859-14 iso-8859-15 iso-8859-16 |
141 |
|
jis_encoding |
142 |
|
koi8-r koi8-u |
143 |
|
x-mac-arabic x-mac-centralroman x-mac-cyrillic x-mac-greek |
144 |
|
x-mac-hebrew x-mac-icelandic macintosh x-mac-turkish |
145 |
|
x-mac-ukrainian x-mac-chinesesimp x-mac-japanese x-mac-korean |
146 |
|
shift_jis shift_jisx0213 x-sjis |
147 |
|
tis-620 |
148 |
|
unicode-1-1-utf-7 unicode-1-1-utf-8 |
149 |
|
unicode-2-0-utf-7 unicode-2-0-utf-8 |
150 |
|
utf-7 utf-8 utf-9 |
151 |
|
viscii |
152 |
|
windows-1250 windows-1251 windows-1252 windows-1253 |
153 |
|
windows-1254 windows-1255 windows-1256 windows-1257 |
154 |
|
windows-1258 windows-31j windows-949 |
155 |
|
)) { $_IsMimeText{$_} = 1 } |
156 |
|
|
157 |
%MSNAME2IANANAME = ( |
%MSNAME2IANANAME = ( |
158 |
'iso-2022-jp' => 'x-iso2022jp-cp932', |
'iso-2022-jp' => 'x-iso2022jp-cp932', |
159 |
'ks_c_5601-1987' => 'windows-949', |
'ks_c_5601-1987' => 'windows-949', |
214 |
|
|
215 |
sub name_normalize ($) { |
sub name_normalize ($) { |
216 |
my $name = lc shift; |
my $name = lc shift; |
217 |
$CHARSET{$name}->{preferred_name} || $name; |
if (ref $CHARSET{$name}->{preferred_name} eq 'CODE') { |
218 |
|
return &{ $CHARSET{$name}->{preferred_name} } ($name); |
219 |
|
} elsif ($CHARSET{$name}->{preferred_name}) { |
220 |
|
return $CHARSET{$name}->{preferred_name}; |
221 |
|
} elsif (ref $CHARSET{'*undef'}->{preferred_name} eq 'CODE') { |
222 |
|
return &{ $CHARSET{'*undef'}->{preferred_name} } ($name); |
223 |
|
} |
224 |
|
$name; |
225 |
} |
} |
226 |
|
|
227 |
sub name_minimumize ($$) { |
sub name_minimumize ($$) { |
515 |
Encode::_utf8_off ($_[0]) if $Encode::VERSION; |
Encode::_utf8_off ($_[0]) if $Encode::VERSION; |
516 |
} |
} |
517 |
|
|
518 |
|
sub is_mime_text ($) { |
519 |
|
my $name = lc shift; |
520 |
|
if (ref $CHARSET{$name}->{mime_text} eq 'CODE') { |
521 |
|
return &{ $CHARSET{$name}->{mime_text} } ($name); |
522 |
|
} elsif (defined $CHARSET{$name}->{mime_text}) { |
523 |
|
return $CHARSET{$name}->{mime_text}; |
524 |
|
} elsif (defined $_IsMimeText{$name}) { |
525 |
|
return $_IsMimeText{$name}; |
526 |
|
} elsif (ref $CHARSET{'*undef'}->{mime_text} eq 'CODE') { |
527 |
|
return &{ $CHARSET{'*undef'}->{mime_text} } ($name); |
528 |
|
} |
529 |
|
0; |
530 |
|
} |
531 |
|
|
532 |
=head1 LICENSE |
=head1 LICENSE |
533 |
|
|
534 |
Copyright 2002 wakaba E<lt>w@suika.fam.cxE<gt>. |
Copyright 2002 wakaba E<lt>w@suika.fam.cxE<gt>. |