Front page | perl.perl5.porters |
Postings from January 2012
Re: pack and ASCII
Thread Previous
|
Thread Next
From:
jpl
Date:
January 9, 2012 07:46
Subject:
Re: pack and ASCII
Message ID:
4F0B0BD6.8010103@research.att.com
On 01/09/12 10:37, demerphq wrote:
> On 9 January 2012 12:30, John P. Linderman (jpl)<jpl@research.att.com> wrote:
>> According to perlfunc.pod, about pack:
>>
>> The TEMPLATE is a sequence of characters that give the order and type
>> of values, as follows:
>>
>> a A string with arbitrary binary data, will be null padded.
>> A A text (ASCII) string, will be space padded.
>> Z A null-terminated (ASCIZ) string, will be null padded.
>>
>> The reference to ASCII (and ASCIZ) seems to be out of date, given recent
>> unicode efforts.
> Er, I dont get it. ASCII and ASCIIZ arent going to stop working just
> because we have improved our unicode support.
>
> Yves
>
>
I was more concerned that the documentation suggested that pack/unpack
would only work on ASCII strings, not on arbitrary strings. Granted,
the length associated with "a" and "A" might need some amplification,
similar to what is there for the "length" function. If pack/unpack
cannot deal with non-ASCII strings (I know they work ok for bytes with
the high-order bit on), then what happens when the corresponding
argument includes non-ASCII characters? -- jpl
Thread Previous
|
Thread Next