diff options
author | Ton Hospel <perl5-porters@ton.iguana.be> | 2005-03-06 18:29:38 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-03-08 17:53:50 +0000 |
commit | f337b084e4f053c4222a0b9a773a9e12c0232e6d (patch) | |
tree | 1292203ca74046d2df21ce05bb8f8289ea14bc8d /pod/perlunicode.pod | |
parent | c478aefb95db58c5f937ab7c70bba552d23df9b2 (diff) | |
download | perl-f337b084e4f053c4222a0b9a773a9e12c0232e6d.tar.gz |
Encoding neutral unpack
Message-Id: <d0fi6i$k06$1@post.home.lunix>
p4raw-id: //depot/perl@24010
Diffstat (limited to 'pod/perlunicode.pod')
-rw-r--r-- | pod/perlunicode.pod | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod index 23bee6eacf..f1308beb1f 100644 --- a/pod/perlunicode.pod +++ b/pod/perlunicode.pod @@ -571,25 +571,24 @@ that make the distinction. Most operators that deal with positions or lengths in a string will automatically switch to using character positions, including C<chop()>, C<chomp()>, C<substr()>, C<pos()>, C<index()>, C<rindex()>, -C<sprintf()>, C<write()>, and C<length()>. Operators that -specifically do not switch include C<vec()>, C<pack()>, and -C<unpack()>. Operators that really don't care include -operators that treats strings as a bucket of bits such as C<sort()>, -and operators dealing with filenames. +C<sprintf()>, C<write()>, and C<length()>. An operator that +specifically does not switch is C<vec()>. Operators that really don't +care include operators that treat strings as a bucket of bits such as +C<sort()>, and operators dealing with filenames. =item * -The C<pack()>/C<unpack()> letters C<c> and C<C> do I<not> change, -since they are often used for byte-oriented formats. Again, think -C<char> in the C language. +The C<pack()>/C<unpack()> letter C<C> does I<not> change, since it is often +used for byte-oriented formats. Again, think C<char> in the C language. There is a new C<U> specifier that converts between Unicode characters -and code points. +and code points. There is also a C<W> specifier that is the equivalent of +C<chr>/C<ord> and properly handles character values even if they are above 255. =item * The C<chr()> and C<ord()> functions work on characters, similar to -C<pack("U")> and C<unpack("U")>, I<not> C<pack("C")> and +C<pack("W")> and C<unpack("W")>, I<not> C<pack("C")> and C<unpack("C")>. C<pack("C")> and C<unpack("C")> are methods for emulating byte-oriented C<chr()> and C<ord()> on Unicode strings. While these methods reveal the internal encoding of Unicode strings, |