summaryrefslogtreecommitdiff
path: root/fml/lib/Mail
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-04-12 13:37:15 +0000
committerfukachan <fukachan>2001-04-12 13:37:15 +0000
commitfac12daba9821a671531ed339bc097823ea85c9d (patch)
tree3fea64f8ec39e4bfe9fd159745cdaf8b01be0df9 /fml/lib/Mail
parent242168ba8efa0d23220f9d26292b4b365b934ddc (diff)
downloadfml8-fac12daba9821a671531ed339bc097823ea85c9d.tar.gz
fml8-fac12daba9821a671531ed339bc097823ea85c9d.tar.bz2
fml8-fac12daba9821a671531ed339bc097823ea85c9d.zip
define look_japanese( $self, $buf ).
It checks $buf looks to contain Japanese string or not.
Diffstat (limited to 'fml/lib/Mail')
-rw-r--r--fml/lib/Mail/Bounce.pm29
1 files changed, 28 insertions, 1 deletions
diff --git a/fml/lib/Mail/Bounce.pm b/fml/lib/Mail/Bounce.pm
index 54f2d74c..b55a492d 100644
--- a/fml/lib/Mail/Bounce.pm
+++ b/fml/lib/Mail/Bounce.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Bounce.pm,v 1.5 2001/04/12 10:46:47 fukachan Exp $
+# $FML: Bounce.pm,v 1.6 2001/04/12 12:06:11 fukachan Exp $
#
package Mail::Bounce;
@@ -104,6 +104,33 @@ sub reason
}
+my $RE_SJIS_C = '[\201-\237\340-\374][\100-\176\200-\374]';
+my $RE_SJIS_S = "($RE_SJIS_C)+";
+my $RE_EUC_C = '[\241-\376][\241-\376]';
+my $RE_EUC_S = "($RE_EUC_C)+";
+my $RE_JIN = '\033\$[\@B]';
+my $RE_JOUT = '\033\([BJ]';
+
+my @REGEXP = (
+ $RE_SJIS_C,
+ $RE_SJIS_S,
+ $RE_EUC_C,
+ $RE_EUC_S,
+ $RE_JIN,
+ $RE_JOUT,
+ );
+
+sub look_japanese
+{
+ my ($self, $buf) = @_;
+
+ for my $regexp (@REGEXP) {
+ return 1 if $buf =~ /$regexp/;
+ }
+
+ 0;
+}
+
=head1 AUTHOR