develooper Front page | perl.perl5.porters | Postings from March 2014

Re: Perl 5.20.0 Blockers, 2014-03-24

Thread Previous | Thread Next
Eric Brine
March 25, 2014 05:20
Re: Perl 5.20.0 Blockers, 2014-03-24
Message ID:
On Mon, Mar 24, 2014 at 11:08 PM, Craig A. Berry <>wrote:

> Does the :crlf layer even work with Unicode?  Some people seem to
> think it doesn't (e.g.,
> <
> >)
> but I don't know enough to evaluate.  If it can be made to work so
> that Unicode handling is not lost, I'm ok with supporting CRLF line
> endings, but it's really a bug in Notepad and not in Perl.

open(my $fh, '>:encoding(UTF-16le)', $qfn)

doesn't work, but

open(my $fh, '>:raw:encoding(UTF-16le):crlf', $qfn)


crlf must be handled after decoding / before encoding. You can get away
with doing it in the incorrect order when using an encoding where CR = 0D,
LF = 0A, but that's not the case using UTF-16le (for example).

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About