Front page | perl.perl5.porters |
Postings from January 2012
Re: pack and ASCII
Thread Previous
|
Thread Next
From:
Leon Timmermans
Date:
January 9, 2012 12:31
Subject:
Re: pack and ASCII
Message ID:
CAHhgV8hqvFGisXxSQQbLnQkOgRy4zujtpY5ESKxikWLVZYuPug@mail.gmail.com
On Mon, Jan 9, 2012 at 8:55 PM, Eric Brine <ikegami@adaelis.com> wrote:
> C<< pack 'A*' >> correctly packs all strings of bytes (whether UTF8=0 or
> UTF8=1). I don't see why it's a bug that it usefully works for characters
> that aren't bytes too. Are you using C<< pack 'A*' >> to validate your data?
> You can use one of the following to do that:
Is also means that «pack "A1", $foo» can't be relied upon to be only
one byte, which means a whole extra layer of validation is necessary.
I find it even more troublesome that pack 'a1' is having the same
issue, despite being documented as «string with arbitrary binary
data».
Quite frankly, I think we absolutely need a for pack formats that have
strong guarantees on number of octets, preferably by the name 'a'.
Leon
Thread Previous
|
Thread Next