Template2 icon indicating copy to clipboard operation
Template2 copied to clipboard

possible bug in tt 2.22 [rt.cpan.org #53688]

Open atoomic opened this issue 7 years ago • 1 comments

Migrated from rt.cpan.org#53688 (status was 'new')

Requestors:

Attachments:

From [email protected] on 2010-01-14 15:57:00:

Hello

I'm not sure it's a bug, but the behaviour changed 
from 2.15 to 2.22 and for me 2.15 was ok

I use it for processing a tt2 file
to obtain a Windows text file, I get a bad newline sequence: \r\r\n 
(I discovered it browsing the resulting attached file tpse_msgs.txt 
with an hex editor) it should be \r\n

With 2.15 everything was OK, the problem appeared after the upgrade to
2.22.
I've tried POST_CHOMP and similar but without obtaining the desired
result.

What I want to obtain is a normal newline sequence (\r\n hex 0D0A)

or go back to 2.15 :-)

best regards

Carlo Caminati


-----------------------------------------------------------------------
* Distribution name and version
    Template-Roolkit 2.22

* Perl version
	This is perl, v5.8.8 built for MSWin32-x86-multi-thread
	(with 18 registered patches, see perl -V for more detail)

	Copyright 1987-2007, Larry Wall

	Binary build 822 [280952] provided by ActiveState
http://www.ActiveState.com
	Built Jul 31 2007 19:34:48

	Perl may be copied only under the terms of either the Artistic
License or the
	GNU General Public License, which may be found in the Perl 5
source kit.

	Complete documentation for Perl, including FAQ lists, should be
found on
	this system using "man perl" or "perldoc perl".  If you have
access to the
	Internet, point your browser at http://www.perl.org/, the Perl
Home Page.

* Operating System vendor and version
      WindowsNT 1 5 x86 (Windows XP SP3)

------------------------------------------------------------------------
-----


------------------------------------------
Carlo Caminati - R&D Network Management
Selta SpA - Roveleto di Cadeo (PC) - Italy
[email protected]  -  www.selta.com
voice:+39 0523 5016200 - fax:+39 0523 5016333

atoomic avatar Oct 05 '18 16:10 atoomic

Content from #121 closed as duplicate:

Migrated from rt.cpan.org#86765 (status was 'new')

Requestors:

From [email protected] on 2013-07-07 23:58:44:

Even with POST_CHOMP and PRE_CHOMP set to 1, my templates come out with an extra CR character at the end of each line. This is a completely breaking bug for me, as my output LaTeX file is rendered invalid.

In 'file.template':
foo
bar
baz
qux

Perl script:
use strict;
use warnings;
use Template;
my $processor = Template->new( PRE_CHOMP => 1, POST_CHOMP => 1 );
my $output;
$processor->process('file.template', {}, \$output);
print $output;

The output is:
foo\r\r\nbar\r\r\nbaz\r\r\nqux\r\r\n

Using Template 2.24, Strawberry Perl 5.16.1, 64 bit.

toddr avatar Oct 05 '18 18:10 toddr