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

Re: Perl 5.20.0 Blockers, 2014-03-24

Thread Previous | Thread Next
From:
Eric Brine
Date:
March 25, 2014 05:20
Subject:
Re: Perl 5.20.0 Blockers, 2014-03-24
Message ID:
CALJW-qFXEkCbS6E9deQM6WVmLCCXKciVQ+Ba9M5uFkQPE3b3xQ@mail.gmail.com
On Mon, Mar 24, 2014 at 11:08 PM, Craig A. Berry <craig.a.berry@gmail.com>wrote:

> Does the :crlf layer even work with Unicode?  Some people seem to
> think it doesn't (e.g.,
> <
> http://stackoverflow.com/questions/3320189/crlf-translation-with-unicode-in-perl
> >)
> 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)

does.

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About