diff options
| author | fukachan <fukachan> | 2003-10-14 12:57:42 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-10-14 12:57:42 +0000 |
| commit | 49d3dd2b43abedc5434975f7ecb297679fc1a551 (patch) | |
| tree | 6bdfbd028c1e49cea6757a69918dee17b9da4f0d /fml/lib/FML/Process | |
| parent | 78999f4581d126a4f5f835632cd70c91f3a50bf7 (diff) | |
| download | fml8-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.
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Kernel.pm | 6 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Utils.pm | 33 |
2 files changed, 35 insertions, 4 deletions
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 |
