[Templates-cvs] cvs commit: Template2/lib Template.pm
cvs@template-toolkit.org
cvs@template-toolkit.org
cvs 06/02/01 11:55:28
Modified: lib Template.pm
Log:
* removed ENCODING
Revision Changes Path
2.84 +5 -16 Template2/lib/Template.pm
Index: Template.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template.pm,v
retrieving revision 2.83
retrieving revision 2.84
diff -u -r2.83 -r2.84
--- Template.pm 2006/02/01 09:05:17 2.83
+++ Template.pm 2006/02/01 11:55:27 2.84
@@ -17,7 +17,7 @@
# modify it under the same terms as Perl itself.
#
# REVISION
-# $Id: Template.pm,v 2.83 2006/02/01 09:05:17 abw Exp $
+# $Id: Template.pm,v 2.84 2006/02/01 11:55:27 abw Exp $
#
#========================================================================
@@ -60,20 +60,10 @@
my ($output, $error);
my $options = (@opts == 1) && UNIVERSAL::isa($opts[0], 'HASH')
? shift(@opts) : { @opts };
-
- unless (defined $options->{ binmode }) {
- my $enc = $options->{ encoding } || $self->{ ENCODING };
- if ($enc) {
- # express encoding as a Perl IO layer
- # e.g. 'utf-8' => ':utf8',
- $enc =~ s/\W//;
- $options->{ binmode } = ":$enc";
- }
- else {
- $options->{ binmode } = $BINMODE;
- }
- }
+ $options->{ binmode } = $BINMODE
+ unless defined $options->{ binmode };
+
# we're using this for testing in t/output.t and t/filter.t so
# don't remove it if you don't want tests to fail...
$self->DEBUG("set binmode\n") if $DEBUG && $options->{ binmode };
@@ -86,7 +76,7 @@
my $outpath = $self->{ OUTPUT_PATH };
$outstream = "$outpath/$outstream" if $outpath;
}
-
+
# send processed template to output stream, checking for error
return ($self->error($error))
if ($error = &_output($outstream, \$output, $options));
@@ -153,7 +143,6 @@
|| Template::Config->service($config)
|| return $self->error(Template::Config->error);
- $self->{ ENCODING } = $config->{ ENCODING };
$self->{ OUTPUT } = $config->{ OUTPUT } || \*STDOUT;
$self->{ OUTPUT_PATH } = $config->{ OUTPUT_PATH };