Skip Menu |

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

Report information

Subject: Broken handling of UTF-8 strings
Hi. I can't get Perl::Tidy to do the right thing with UTF-8 strings. I've attached a test case with a source file (test.pl), the expected output (want.pl.tdy) and the actual output (got.pl.tdy). The problem arises because Perl::Tidy considers "Für" to be 4 characters rather than 3, courtesy of length(), which returns the number of bytes rather than the number of characters, unless the string "is in Unicode". perl 5.8.8 Linux 2.6.22 Perl::Tidy 20071205
Subject: test.pl
my $test = [ "Für Elise" => "Beethoven", "Eine kleine Nachtmusik" => "Mozart" ];
Subject: want.pl.tdy
Download want.pl.tdy
application/octet-stream 103b

Message body not shown because it is not plain text.

Subject: got.pl.tdy
Download got.pl.tdy
application/octet-stream 102b

Message body not shown because it is not plain text.

On Sun Feb 03 23:42:09 2008, CHOCOLATE wrote: Show quoted text
> Hi. > > I can't get Perl::Tidy to do the right thing with UTF-8 strings. > > I've attached a test case with a source file (test.pl), the expected > output (want.pl.tdy) and the actual output (got.pl.tdy). > > The command was perltidy -fnl test.pl > > The problem arises because Perl::Tidy considers "Für" to be 4 characters > rather than 3, courtesy of length(), which returns the number of bytes > rather than the number of characters, unless the string "is in Unicode". > > perl 5.8.8 > Linux 2.6.22 > Perl::Tidy 20071205
I think this is no bug as long as you do not "use utf8", because the strings should be interpreted as byte strings then. perltidy, however, does not seem to honor "use utf8" yet, so the indentation will still be incorrect despite this pragma being in effect, which I consider a bug, too. :-) Regards, fany
From: sebastian [...] podjasek.pl
On Nd 07 Gru 2008, 09:10:15, FANY wrote: Show quoted text
> perltidy, however, does not seem to honor "use utf8" yet, so the > indentation will still be incorrect despite this pragma being in effect, > which I consider a bug, too. :-)
Just a tiny little change which solves this bug - at least for me.
Subject: 0001-Fix-indentation-of-wide-characters.patch
From 203ea7adfd66a00ebb104af882c4d96faf244230 Mon Sep 17 00:00:00 2001 From: Sebastian Podjasek <sebastian@podjasek.pl> Date: Tue, 13 May 2014 08:43:07 +0200 Subject: [PATCH] Fix indentation of wide-characters --- lib/Perl/Tidy.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index c326a8f..19b92bd 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -165,6 +165,7 @@ EOM } $fh = $New->( $filename, $mode ) or Warn("Couldn't open file:$filename in mode:$mode : $!\n"); + $fh->binmode(':utf8'); return $fh, ( $ref or $filename ); } -- 1.9.1
Subject: Re: [rt.cpan.org #32905] Broken handling of UTF-8 strings
Date: Tue, 13 May 2014 06:37:10 -0700
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: Steven Hancock <s7078hancock [...] gmail.com>
Sebastian, thanks. Steve On Tuesday, May 13, 2014, Sebastian Podjasek via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Queue: Perl-Tidy > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=32905 > > > On Nd 07 Gru 2008, 09:10:15, FANY wrote:
> > perltidy, however, does not seem to honor "use utf8" yet, so the > > indentation will still be incorrect despite this pragma being in effect, > > which I consider a bug, too. :-)
> > Just a tiny little change which solves this bug - at least for me. >
From: sebastian [...] podjasek.pl
Previous patch would cause problems when using Perl::Tidy with string as an argument (Perl::Tidy::IOScalar does not implement binmode method). Also added some tests for this issue.
Subject: 0001-Fix-indentation-of-wide-characters.patch
From c572d03d038eb2c9cb663b2484ae48cef35073ce Mon Sep 17 00:00:00 2001 From: Sebastian Podjasek <sebastian.podjasek@intelliway.pl> Date: Tue, 13 May 2014 08:43:07 +0200 Subject: [PATCH] Fix indentation of wide-characters --- lib/Perl/Tidy.pm | 1 + t/testwide.pl.src | 4 ++++ t/testwide.t | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 t/testwide.pl.src create mode 100644 t/testwide.t diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index c326a8f..69d2788 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -165,6 +165,7 @@ EOM } $fh = $New->( $filename, $mode ) or Warn("Couldn't open file:$filename in mode:$mode : $!\n"); + $fh->binmode(':utf8') if $fh->can('binmode'); return $fh, ( $ref or $filename ); } diff --git a/t/testwide.pl.src b/t/testwide.pl.src new file mode 100644 index 0000000..10eec3a --- /dev/null +++ b/t/testwide.pl.src @@ -0,0 +1,4 @@ +%pangrams=("Plain","ASCII", +"Zwölf große Boxkämpfer jagen Vik quer über den Sylter.","DE", +"Jeż wlókł gęś. Uf! Bądź choć przy nim, stań!","PL", +"Любя, съешь щипцы, — вздохнёт мэр, — кайф жгуч.","RU"); \ No newline at end of file diff --git a/t/testwide.t b/t/testwide.t new file mode 100644 index 0000000..e96dfdd --- /dev/null +++ b/t/testwide.t @@ -0,0 +1,48 @@ +use strict; +use utf8; +use Test; +use Carp; +use FindBin; +BEGIN {plan tests => 2} +use Perl::Tidy; + + +my $source = <<'EOM'; +%pangrams=("Plain","ASCII", +"Zwölf große Boxkämpfer jagen Vik quer über den Sylter.","DE", +"Jeż wlókł gęś. Uf! Bądź choć przy nim, stań!","PL", +"Любя, съешь щипцы, — вздохнёт мэр, — кайф жгуч.","RU"); +EOM + +my $expected_output=<<'EOM'; +%pangrams = ( + "Plain", "ASCII", + "Zwölf große Boxkämpfer jagen Vik quer über den Sylter.", "DE", + "Jeż wlókł gęś. Uf! Bądź choć przy nim, stań!", "PL", + "Любя, съешь щипцы, — вздохнёт мэр, — кайф жгуч.", "RU" + ); +EOM + +my $perltidyrc = <<'EOM'; +-gnu +EOM + +my $output; + +Perl::Tidy::perltidy( + source => \$source, + destination => \$output, + perltidyrc => \$perltidyrc, + argv => '-nsyn', +); + +ok($output, $expected_output); + +Perl::Tidy::perltidy( + source => $FindBin::Bin . '/testwide.pl.src', + destination => \$output, + perltidyrc => \$perltidyrc, + argv => '-nsyn', +); + +ok($output, $expected_output); -- 1.9.1
Subject: Re: [rt.cpan.org #32905] Broken handling of UTF-8 strings
Date: Sat, 26 Jul 2014 16:38:52 -0700
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: Steven Hancock <s7078hancock [...] gmail.com>
Sebastian, Thanks for the updated patch. I would be interested in putting this in to the next release on an experimental basis, but at least for now it would have to be turned on with a flag since otherwise it will cause problems with some existing scripts. Do you have a suggested name for the flag? Thanks, Steve On Fri, Jul 25, 2014 at 12:59 AM, Sebastian Podjasek via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Queue: Perl-Tidy > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=32905 > > > Previous patch would cause problems when using Perl::Tidy with string as > an argument (Perl::Tidy::IOScalar does not implement binmode method). Also > added some tests for this issue. >
From: sebastian [...] podjasek.pl
On Sob 26 Lip 2014, 19:39:07, s7078hancock@gmail.com wrote: Show quoted text
> Do you have a suggested name for the flag?
-wide / --wide-chars seems to be related to issue solved. As I've seen -wc is already taken.
Subject: Re: [rt.cpan.org #32905] Broken handling of UTF-8 strings
Date: Sat, 8 Nov 2014 05:30:35 -0800
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: Steven Hancock <s7078hancock [...] gmail.com>
That seems okay, or even -wch / --wide-characters Steve On Fri, Nov 7, 2014 at 4:00 PM, Sebastian Podjasek via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Queue: Perl-Tidy > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=32905 > > > On Sob 26 Lip 2014, 19:39:07, s7078hancock@gmail.com wrote:
> > Do you have a suggested name for the flag?
> > -wide / --wide-chars > > seems to be related to issue solved. As I've seen -wc is already taken. >
Here is the more portable solution, that works with any source type (ScalarRef, handle, ArrayRef). --- "d:\\downloads\\Tidy.pm" 2015-08-15 03:18:51.000000000 +0300 +++ "d:\\devel\\perl\\perl\\site\\lib\\Perl\\Tidy.pm" 2015-08-15 07:47:21.570789700 +0300 @@ -173,12 +173,6 @@ $fh = $New->( $filename, $mode ) or Warn("Couldn't open file:$filename in mode:$mode : $!\n"); - # The first call here will be to read the config file, which is before - # the --encoding has been set, so the config file cannot be read as utf8 - $fh->binmode(':encoding(utf8)') - if ( $rOpts_character_encoding - && $rOpts_character_encoding eq 'utf8' - && $fh->can('binmode') ); return $fh, ( $ref or $filename ); } @@ -811,12 +805,23 @@ # Prefilters and postfilters: The prefilter is a code reference # that will be applied to the source before tidying, and the # postfilter is a code reference to the result before outputting. - if ($prefilter) { + if ( $prefilter || ( $rOpts_character_encoding && $rOpts_character_encoding eq 'utf8' ) ) { my $buf = ''; while ( my $line = $source_object->get_line() ) { $buf .= $line; } - $buf = $prefilter->($buf); + + $buf = $prefilter->($buf) if $prefilter; + + if ( $rOpts_character_encoding && $rOpts_character_encoding eq 'utf8' && !utf8::is_utf8($buf) ) { + require Encode; + + eval { + $buf = Encode::decode('UTF-8', $buf, Encode::FB_CROAK | Encode::LEAVE_SRC); + }; + + Die "unable to decode source\n" if $@; + } $source_object = Perl::Tidy::LineSource->new( \$buf, $rOpts, $rpending_logfile_message );
Subject: patch.txt
--- "d:\\downloads\\Tidy.pm" 2015-08-15 03:18:51.000000000 +0300 +++ "d:\\devel\\perl\\perl\\site\\lib\\Perl\\Tidy.pm" 2015-08-15 07:47:21.570789700 +0300 @@ -173,12 +173,6 @@ $fh = $New->( $filename, $mode ) or Warn("Couldn't open file:$filename in mode:$mode : $!\n"); - # The first call here will be to read the config file, which is before - # the --encoding has been set, so the config file cannot be read as utf8 - $fh->binmode(':encoding(utf8)') - if ( $rOpts_character_encoding - && $rOpts_character_encoding eq 'utf8' - && $fh->can('binmode') ); return $fh, ( $ref or $filename ); } @@ -811,12 +805,23 @@ # Prefilters and postfilters: The prefilter is a code reference # that will be applied to the source before tidying, and the # postfilter is a code reference to the result before outputting. - if ($prefilter) { + if ( $prefilter || ( $rOpts_character_encoding && $rOpts_character_encoding eq 'utf8' ) ) { my $buf = ''; while ( my $line = $source_object->get_line() ) { $buf .= $line; } - $buf = $prefilter->($buf); + + $buf = $prefilter->($buf) if $prefilter; + + if ( $rOpts_character_encoding && $rOpts_character_encoding eq 'utf8' && !utf8::is_utf8($buf) ) { + require Encode; + + eval { + $buf = Encode::decode('UTF-8', $buf, Encode::FB_CROAK | Encode::LEAVE_SRC); + }; + + Die "unable to decode source\n" if $@; + } $source_object = Perl::Tidy::LineSource->new( \$buf, $rOpts, $rpending_logfile_message );
Subject: Re: [rt.cpan.org #32905] Broken handling of UTF-8 strings
Date: Sat, 15 Aug 2015 06:58:21 -0700
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: Steven Hancock <s7078hancock [...] gmail.com>
Dmytro, Thanks for the patch, this looks like a better way to go. I changed the 'require' to 'use' to get it to work without complaints. When I tested it on a file I noticed that the output file was not UTF-8 on my system, so I think that the previous coding may need to be retained when the $mode is write. Any other comments are very welcome. I assume that I will be getting more suggestions for improvement once this version starts to get used, so I will probably need to do another release fairly soon. Steve On Fri, Aug 14, 2015 at 9:56 PM, Dmytro Zagashev via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Queue: Perl-Tidy > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=32905 > > > Here is the more portable solution, that works with any source type > (ScalarRef, handle, ArrayRef). > > --- "d:\\downloads\\Tidy.pm" 2015-08-15 03:18:51.000000000 +0300 > +++ "d:\\devel\\perl\\perl\\site\\lib\\Perl\\Tidy.pm" 2015-08-15 > 07:47:21.570789700 +0300 > @@ -173,12 +173,6 @@ > $fh = $New->( $filename, $mode ) > or Warn("Couldn't open file:$filename in mode:$mode : $!\n"); > > - # The first call here will be to read the config file, which is before > - # the --encoding has been set, so the config file cannot be read as > utf8 > - $fh->binmode(':encoding(utf8)') > - if ( $rOpts_character_encoding > - && $rOpts_character_encoding eq 'utf8' > - && $fh->can('binmode') ); > return $fh, ( $ref or $filename ); > } > > @@ -811,12 +805,23 @@ > # Prefilters and postfilters: The prefilter is a code reference > # that will be applied to the source before tidying, and the > # postfilter is a code reference to the result before outputting. > - if ($prefilter) { > + if ( $prefilter || ( $rOpts_character_encoding && > $rOpts_character_encoding eq 'utf8' ) ) { > my $buf = ''; > while ( my $line = $source_object->get_line() ) { > $buf .= $line; > } > - $buf = $prefilter->($buf); > + > + $buf = $prefilter->($buf) if $prefilter; > + > + if ( $rOpts_character_encoding && > $rOpts_character_encoding eq 'utf8' && !utf8::is_utf8($buf) ) { > + require Encode; > + > + eval { > + $buf = Encode::decode('UTF-8', > $buf, Encode::FB_CROAK | Encode::LEAVE_SRC); > + }; > + > + Die "unable to decode source\n" if $@; > + } > > $source_object = Perl::Tidy::LineSource->new( \$buf, $rOpts, > $rpending_logfile_message ); > > --- "d:\\downloads\\Tidy.pm" 2015-08-15 03:18:51.000000000 +0300 > +++ "d:\\devel\\perl\\perl\\site\\lib\\Perl\\Tidy.pm" 2015-08-15 > 07:47:21.570789700 +0300 > @@ -173,12 +173,6 @@ > $fh = $New->( $filename, $mode ) > or Warn("Couldn't open file:$filename in mode:$mode : $!\n"); > > - # The first call here will be to read the config file, which is before > - # the --encoding has been set, so the config file cannot be read as > utf8 > - $fh->binmode(':encoding(utf8)') > - if ( $rOpts_character_encoding > - && $rOpts_character_encoding eq 'utf8' > - && $fh->can('binmode') ); > return $fh, ( $ref or $filename ); > } > > @@ -811,12 +805,23 @@ > # Prefilters and postfilters: The prefilter is a code reference > # that will be applied to the source before tidying, and the > # postfilter is a code reference to the result before outputting. > - if ($prefilter) { > + if ( $prefilter || ( $rOpts_character_encoding && > $rOpts_character_encoding eq 'utf8' ) ) { > my $buf = ''; > while ( my $line = $source_object->get_line() ) { > $buf .= $line; > } > - $buf = $prefilter->($buf); > + > + $buf = $prefilter->($buf) if $prefilter; > + > + if ( $rOpts_character_encoding && > $rOpts_character_encoding eq 'utf8' && !utf8::is_utf8($buf) ) { > + require Encode; > + > + eval { > + $buf = Encode::decode('UTF-8', > $buf, Encode::FB_CROAK | Encode::LEAVE_SRC); > + }; > + > + Die "unable to decode source\n" if $@; > + } > > $source_object = Perl::Tidy::LineSource->new( \$buf, $rOpts, > $rpending_logfile_message ); > >
From: qsimpleq
Update Dmytro's patch. Add utf8 support for output files too. Суб Авг 15 09:58:34 2015, s7078hancock@gmail.com писал: Show quoted text
> Dmytro, > Thanks for the patch, this looks like a better way to go. I changed > the > 'require' to 'use' to get it to work without complaints. When I > tested it > on a file I noticed that the output file was not UTF-8 on my system, > so I > think that the previous coding may need to be retained when the $mode > is > write. > > Any other comments are very welcome. I assume that I will be getting > more > suggestions for improvement once this version starts to get used, so I > will > probably need to do another release fairly soon.
Subject: fix-utf8-output-for-std-and-files.patch
--- Tidy.pm.orig 2015-12-10 15:20:42.236631385 +0500 +++ Tidy.pm 2015-12-10 15:19:01.052440351 +0500 @@ -74,6 +74,7 @@ @EXPORT = qw( &perltidy ); use Cwd; +use Encode (); use IO::File; use File::Basename; use File::Copy; @@ -173,12 +174,6 @@ $fh = $New->( $filename, $mode ) or Warn("Couldn't open file:$filename in mode:$mode : $!\n"); - # The first call here will be to read the config file, which is before - # the --encoding has been set, so the config file cannot be read as utf8 - $fh->binmode(':encoding(utf8)') - if ( $rOpts_character_encoding - && $rOpts_character_encoding eq 'utf8' - && $fh->can('binmode') ); return $fh, ( $ref or $filename ); } @@ -811,12 +806,20 @@ # Prefilters and postfilters: The prefilter is a code reference # that will be applied to the source before tidying, and the # postfilter is a code reference to the result before outputting. - if ($prefilter) { + if ( $prefilter || ( $rOpts_character_encoding && $rOpts_character_encoding eq 'utf8' ) ) { my $buf = ''; while ( my $line = $source_object->get_line() ) { $buf .= $line; } - $buf = $prefilter->($buf); + + $buf = $prefilter->($buf) if $prefilter; + + if ( $rOpts_character_encoding && $rOpts_character_encoding eq 'utf8' && !utf8::is_utf8($buf) ) { + eval { + $buf = Encode::decode('UTF-8', $buf, Encode::FB_CROAK | Encode::LEAVE_SRC); + }; + Die "unable to decode source\n" if $@; + } $source_object = Perl::Tidy::LineSource->new( \$buf, $rOpts, $rpending_logfile_message ); @@ -3935,7 +3938,10 @@ $output_file_open = 1; if ($binmode) { if ( ref($fh) eq 'IO::File' ) { - binmode $fh; + if ( $rOpts->{'character-encoding'} && $rOpts->{'character-encoding'} eq 'utf8' ) { + binmode $fh, ":encoding(UTF-8)"; + } + else { binmode $fh } } if ( $output_file eq '-' ) { binmode STDOUT } }
Version 20160301 of perltidy has the latest patch, thanks. I think this issue is closed now but will leave the RT ticket open for a while.
From: qsimpleq
Суб Фев 27 12:50:24 2016, SHANCOCK : Show quoted text
> this issue is closed now but will leave the RT ticket open for a > while.
And it was the right decision. -st -utf8 continued to be broken. fixed by patch
Subject: utf8.diff
--- Tidy.pm_old 2016-03-01 19:46:22.000000000 +0500 +++ Tidy.pm 2016-04-25 16:04:09.984426450 +0500 @@ -3955,15 +3959,13 @@ unless ($fh) { Perl::Tidy::Die "Cannot write to output stream\n"; } $output_file_open = 1; if ($binmode) { - if ( ref($fh) eq 'IO::File' ) { - if ( $rOpts->{'character-encoding'} - && $rOpts->{'character-encoding'} eq 'utf8' ) + if ( $rOpts->{'character-encoding'} + && $rOpts->{'character-encoding'} eq 'utf8' ) { - binmode $fh, ":encoding(UTF-8)"; + if ( ref($fh) eq 'IO::File' ) { $fh->binmode(":encoding(UTF-8)"); } + elsif ( $output_file eq '-' ) { binmode STDOUT, ":encoding(UTF-8)"; } } - else { binmode $fh } - } - if ( $output_file eq '-' ) { binmode STDOUT } + elsif ( $output_file eq '-' ) { binmode STDOUT } } }
From: qsimpleq
Суб Фев 27 12:50:24 2016, SHANCOCK : Show quoted text
> this issue is closed now but will leave the RT ticket open for a > while.
And it was the right decision. -st -utf8 continued to be broken. fixed by patch
Subject: utf8.diff
--- Tidy.pm_old 2016-03-01 19:46:22.000000000 +0500 +++ Tidy.pm 2016-04-25 16:04:09.984426450 +0500 @@ -3955,15 +3959,13 @@ unless ($fh) { Perl::Tidy::Die "Cannot write to output stream\n"; } $output_file_open = 1; if ($binmode) { - if ( ref($fh) eq 'IO::File' ) { - if ( $rOpts->{'character-encoding'} - && $rOpts->{'character-encoding'} eq 'utf8' ) + if ( $rOpts->{'character-encoding'} + && $rOpts->{'character-encoding'} eq 'utf8' ) { - binmode $fh, ":encoding(UTF-8)"; + if ( ref($fh) eq 'IO::File' ) { $fh->binmode(":encoding(UTF-8)"); } + elsif ( $output_file eq '-' ) { binmode STDOUT, ":encoding(UTF-8)"; } } - else { binmode $fh } - } - if ( $output_file eq '-' ) { binmode STDOUT } + elsif ( $output_file eq '-' ) { binmode STDOUT } } }
Subject: Re: [rt.cpan.org #32905] Broken handling of UTF-8 strings
Date: Mon, 25 Apr 2016 12:22:01 -0700
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: Steven Hancock <perltidy [...] users.sourceforge.net>
Thanks for the report and patch. Steve On Mon, Apr 25, 2016 at 4:40 AM, http://mrakobes86reg.id.bk.ru/ via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Queue: Perl-Tidy > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=32905 > > > Суб Фев 27 12:50:24 2016, SHANCOCK :
> > this issue is closed now but will leave the RT ticket open for a > > while.
> > And it was the right decision. -st -utf8 continued to be broken. fixed by > patch > > --- Tidy.pm_old 2016-03-01 19:46:22.000000000 +0500 > +++ Tidy.pm 2016-04-25 16:04:09.984426450 +0500 > @@ -3955,15 +3959,13 @@ > unless ($fh) { Perl::Tidy::Die "Cannot write to output stream\n"; > } > $output_file_open = 1; > if ($binmode) { > - if ( ref($fh) eq 'IO::File' ) { > - if ( $rOpts->{'character-encoding'} > - && $rOpts->{'character-encoding'} eq 'utf8' ) > + if ( $rOpts->{'character-encoding'} > + && $rOpts->{'character-encoding'} eq 'utf8' ) > { > - binmode $fh, ":encoding(UTF-8)"; > + if ( ref($fh) eq 'IO::File' ) { > $fh->binmode(":encoding(UTF-8)"); } > + elsif ( $output_file eq '-' ) { binmode STDOUT, > ":encoding(UTF-8)"; } > } > - else { binmode $fh } > - } > - if ( $output_file eq '-' ) { binmode STDOUT } > + elsif ( $output_file eq '-' ) { binmode STDOUT } > } > } > >
This patch is implemented in version 20170521.
I think this can be closed now