summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-10-14 12:57:42 +0000
committerfukachan <fukachan>2003-10-14 12:57:42 +0000
commit49d3dd2b43abedc5434975f7ecb297679fc1a551 (patch)
tree6bdfbd028c1e49cea6757a69918dee17b9da4f0d
parent78999f4581d126a4f5f835632cd70c91f3a50bf7 (diff)
downloadfml8-49d3dd2b43abedc5434975f7ecb297679fc1a551.tar.gz
fml8-49d3dd2b43abedc5434975f7ecb297679fc1a551.tar.bz2
fml8-49d3dd2b43abedc5434975f7ecb297679fc1a551.zip
implement get_charset() and set_charset(). modified to use it to
treat current charset changed dynamically on the fly.
-rw-r--r--fml/lib/FML/Command/SendFile.pm6
-rw-r--r--fml/lib/FML/Digest.pm4
-rw-r--r--fml/lib/FML/Process/Kernel.pm6
-rw-r--r--fml/lib/FML/Process/Utils.pm33
4 files changed, 40 insertions, 9 deletions
diff --git a/fml/lib/FML/Command/SendFile.pm b/fml/lib/FML/Command/SendFile.pm
index 7d5aa553..57dde5b8 100644
--- a/fml/lib/FML/Command/SendFile.pm
+++ b/fml/lib/FML/Command/SendFile.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: SendFile.pm,v 1.30 2003/08/23 07:24:42 fukachan Exp $
+# $FML: SendFile.pm,v 1.31 2003/08/29 15:33:57 fukachan Exp $
#
package FML::Command::SendFile;
@@ -85,7 +85,7 @@ sub send_article
my $config = $curproc->config();
my $ml_name = $config->{ ml_name };
my $spool_dir = $config->{ spool_dir };
- my $charset = $config->{ template_file_charset };
+ my $charset = $curproc->get_charset("template_file");
my $is_error = 0;
# command buffer = get 1
@@ -179,7 +179,7 @@ sub send_file
# XXX-TODO: handle non Japanese.
# XXX-TODO: care for Accept-Language: header field.
- my $charset = $config->{ reply_message_charset };
+ my $charset = $curproc->get_charset("reply_message");
# XXX-TODO: who validate $filename and $filepath ?
$curproc->log("send_file: $filepath");
diff --git a/fml/lib/FML/Digest.pm b/fml/lib/FML/Digest.pm
index 7b218732..79bc861d 100644
--- a/fml/lib/FML/Digest.pm
+++ b/fml/lib/FML/Digest.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: Digest.pm,v 1.11 2003/08/23 14:37:58 fukachan Exp $
+# $FML: Digest.pm,v 1.12 2003/08/29 15:33:54 fukachan Exp $
#
package FML::Digest;
@@ -185,7 +185,7 @@ sub create_multipart_message
my $config = $curproc->config();
my $ml_name = $config->{ ml_name };
my $ml_addr = $config->{ address_for_post };
- my $charset = $config->{ template_file_charset };
+ my $charset = $curproc->get_charset("template_file");
my $seq_file = $config->{ digest_sequence_file };
my $rcptmaps = $config->get_as_array_ref('digest_recipient_maps');
my $count_ok = 0;
diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm
index 1e2afe2b..98018260 100644
--- a/fml/lib/FML/Process/Kernel.pm
+++ b/fml/lib/FML/Process/Kernel.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: Kernel.pm,v 1.183 2003/09/27 06:55:11 fukachan Exp $
+# $FML: Kernel.pm,v 1.184 2003/10/14 06:58:10 fukachan Exp $
#
package FML::Process::Kernel;
@@ -1675,7 +1675,7 @@ sub message_nl
my $config = $curproc->config();
my $dir = $config->{ message_template_dir };
my $local_dir = $config->{ ml_local_message_template_dir };
- my $charset = $config->{ template_file_charset } || 'en';
+ my $charset = $curproc->get_charset("template_file");
my $buf = '';
use File::Spec;
@@ -1797,7 +1797,7 @@ sub queue_in
my $pcb = $curproc->pcb();
my $config = $curproc->config();
my $sender = $config->{ maintainer };
- my $charset = $config->{ "${category}_charset" } || 'us-ascii';
+ my $charset = $curproc->get_charset($category);
my $subject = $config->{ "${category}_subject" };
my $reply_to = $config->{ address_for_command };
my $is_multipart = 0;
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm
index 726666c2..4fd8b5a0 100644
--- a/fml/lib/FML/Process/Utils.pm
+++ b/fml/lib/FML/Process/Utils.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: Utils.pm,v 1.80 2003/09/19 13:08:56 fukachan Exp $
+# $FML: Utils.pm,v 1.81 2003/09/25 11:36:25 fukachan Exp $
#
package FML::Process::Utils;
@@ -1398,6 +1398,37 @@ sub language_of_html_file
}
+# Descriptions: set the current charset
+# Arguments: OBJ($curproc) STR($category) STR($charset)
+# Side Effects: none
+# Return Value: none
+sub set_charset
+{
+ my ($curproc, $category, $charset) = @_;
+ my $pcb = $curproc->pcb();
+
+ $pcb->set("charset", $category, $charset);
+}
+
+
+# Descriptions: get the current charset.
+# The default value is given by $template_file_charset.
+# Arguments: OBJ($curproc) STR($category)
+# Side Effects: none
+# Return Value: STR
+sub get_charset
+{
+ my ($curproc, $category) = @_;
+ my $config = $curproc->config();
+ my $pcb = $curproc->pcb();
+ my $category = $category || "template_file";
+ my $default = $config->{ "${category}_charset" } || 'us-ascii';
+ my $charset = $pcb->get("charset", $category) || $default || 'us-ascii';
+
+ return $charset;
+}
+
+
=head2 thread_db_args($args)
prepare and return information (HASH_REF) needed to manipulate thread