[Templates-cvs] cvs commit: Template2/lib Template.pm

cvs@template-toolkit.org cvs@template-toolkit.org


cvs         06/02/01 08:54:12

  Modified:    lib      Template.pm
  Log:
  * added ENCODING option
  
  Revision  Changes    Path
  2.82      +5 -2      Template2/lib/Template.pm
  
  Index: Template.pm
  ===================================================================
  RCS file: /template-toolkit/Template2/lib/Template.pm,v
  retrieving revision 2.81
  retrieving revision 2.82
  diff -u -r2.81 -r2.82
  --- Template.pm	2006/01/30 19:55:12	2.81
  +++ Template.pm	2006/02/01 08:54:11	2.82
  @@ -17,7 +17,7 @@
   #   modify it under the same terms as Perl itself.
   #
   # REVISION
  -#   $Id: Template.pm,v 2.81 2006/01/30 19:55:12 abw Exp $
  +#   $Id: Template.pm,v 2.82 2006/02/01 08:54:11 abw Exp $
   #
   #========================================================================
    
  @@ -143,6 +143,7 @@
           || 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 };
   
  @@ -192,7 +193,9 @@
           }
           elsif (open(FP, ">$where")) { 
               # binmode option can be 1 or a specific layer, e.g. :utf8
  -            my $bm = $options->{ binmode };
  +            my $bm = $options->{ binmode  } 
  +                  || $options->{ encoding }
  +                  || $self->{ ENCODING };
               if ($bm && +$bm == 1) { 
                   binmode FP;
               }