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.