.# Discussion
When using `binmode ... ":encoding(UTF8)"`, the CRLF translation layer is left in-place.
As used prior to this commit, on Windows machines, this `binmode` setting causes
the output file to be converted to "DOS" CRLF line endings regardless of other settings.
`binmode ... ":raw:encoding(UTF8)"` will enable UTF-8 without the CRLF translation layer.
if ( $rOpts->{'character-encoding'}
&& $rOpts->{'character-encoding'} eq 'utf8' )
{
- binmode $fout, ":encoding(UTF-8)";
+ binmode $fout, ":raw:encoding(UTF-8)";
}
else { binmode $fout }
}
&& $rOpts->{'character-encoding'} eq 'utf8' )
{
if ( ref($fh) eq 'IO::File' ) {
- $fh->binmode(":encoding(UTF-8)");
+ $fh->binmode(":raw:encoding(UTF-8)");
}
elsif ( $output_file eq '-' ) {
- binmode STDOUT, ":encoding(UTF-8)";
+ binmode STDOUT, ":raw:encoding(UTF-8)";
}
}