summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorYitzchak Scott-Thoennes <sthoenna@efn.org>2000-11-10 01:47:15 -0800
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-13 04:05:07 +0000
commita1ca4561f20dbf547f57d39a690790cbe33210da (patch)
tree83f9af82cb7a2699ca5ca248e9907ac52b3924a8 /pod
parentd26ab924bbea5dd5379307deb59c11af3692350b (diff)
downloadperl-a1ca4561f20dbf547f57d39a690790cbe33210da.tar.gz
Tweak the definition of the bit complement on UTF-8 data:
if none of the characters in the string are > 0xff, the result is a complemented byte string, not a (UTF-8) char string. Based on the summary in Subject: Re: [ID 20000918.005] ~ on wide chars Message-ID: <jSDD6gzkgi/T092yn@efn.org> This should give us the maximum backward (pre-char string) compatibility and utf8 compatibility. The other alternative would be to limit the bit complement to be always byte only, taking the least significant byte of the chars. p4raw-id: //depot/perl@7665
Diffstat (limited to 'pod')
-rw-r--r--pod/perlunicode.pod12
1 files changed, 12 insertions, 0 deletions
diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod
index e567e183e1..30a4482260 100644
--- a/pod/perlunicode.pod
+++ b/pod/perlunicode.pod
@@ -198,6 +198,18 @@ byte-oriented C<chr()> and C<ord()> under utf8.
=item *
+The bit string operators C<& | ^ ~> can operate on character data.
+However, for backward compatibility reasons (bit string operations
+when the characters all are less than 256 in ordinal value) one cannot
+mix C<~> (the bit complement) and characters both less than 256 and
+equal or greater than 256. Most importantly, the DeMorgan's laws
+(C<~($x|$y) eq ~$x&~$y>, C<~($x&$y) eq ~$x|~$y>) won't hold.
+Another way to look at this is that the complement cannot return
+B<both> the 8-bit (byte) wide bit complement, and the full character
+wide bit complement.
+
+=item *
+
And finally, C<scalar reverse()> reverses by character rather than by byte.
=back