Skip Menu |

This queue is for tickets about the Perl-Tidy CPAN distribution.

Report information
The Basics
Id: 120968
Status: resolved
Priority: 0/
Queue: Perl-Tidy

People
Owner: Nobody in particular
Requestors: Heinz.Knutzen [...] dataport.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: -enc=utf8 doesn't work together with --backup-and-modify-in-place
Date: Wed, 5 Apr 2017 15:08:27 +0000
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: "Knutzen, Heinz" <heinz.knutzen [...] dataport.de>
If pertidy is applied to an utf8 encoded file, and if both options -backup-and-modify-in-place and -enc=utf8 are enabled, then the output file is erroneously written in latin1 encoding. Analysis: In case of option -backup-and-modify-in-place, in a first step, the output is written to a temporary file in correct encoding. In a second step the temp file is copied back to the original file. This second step ignores the utf8 option by mistake. The attached patch should fix this. perltidy v20160302 perl v5.24.0

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #120968] -enc=utf8 doesn't work together with --backup-and-modify-in-place
Date: Wed, 5 Apr 2017 13:06:05 -0700
To: bug-Perl-Tidy [...] rt.cpan.org
From: Steven Hancock <s7078hancock [...] gmail.com>
Heinz, Thanks for the patch. Steve On 4/5/17, Heinz.Knutzen via RT <bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Wed Apr 05 11:25:40 2017: Request 120968 was acted upon. > Transaction: Ticket created by Heinz.Knutzen@dataport.de > Queue: Perl-Tidy > Subject: -enc=utf8 doesn't work together with > --backup-and-modify-in-place > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: Heinz.Knutzen@dataport.de > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=120968 > > > > If pertidy is applied to an utf8 encoded file, > and if both options -backup-and-modify-in-place and -enc=utf8 are enabled, > then the output file is erroneously written in latin1 encoding. > > Analysis: > In case of option -backup-and-modify-in-place, > in a first step, the output is written to a temporary file in correct > encoding. > In a second step the temp file is copied back to the original file. > This second step ignores the utf8 option by mistake. > > The attached patch should fix this. > > perltidy v20160302 > perl v5.24.0 > >
This is implemented in version 20170521.