summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/utf8.pm
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2022-03-14 10:08:50 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2022-03-14 10:08:50 +0000
commit49b9d8ffc05bf0c271287eb1390cabad28c6a47a (patch)
treee2e1779b1d4795d6b2c3bf92a4e2e4154d82124b /Master/tlpkg/tlperl/lib/utf8.pm
parentf03a75ebd3b935ecde4dde32687fbe86161c30ed (diff)
New tlperl 5.34
git-svn-id: svn://tug.org/texlive/trunk@62701 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/utf8.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/utf8.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/Master/tlpkg/tlperl/lib/utf8.pm b/Master/tlpkg/tlperl/lib/utf8.pm
index 607c59df742..823193b8c13 100644
--- a/Master/tlpkg/tlperl/lib/utf8.pm
+++ b/Master/tlpkg/tlperl/lib/utf8.pm
@@ -1,15 +1,19 @@
package utf8;
-$utf8::hint_bits = 0x00800000;
+use strict;
+use warnings;
-our $VERSION = '1.22';
+our $hint_bits = 0x00800000;
+
+our $VERSION = '1.24';
+our $AUTOLOAD;
sub import {
- $^H |= $utf8::hint_bits;
+ $^H |= $hint_bits;
}
sub unimport {
- $^H &= ~$utf8::hint_bits;
+ $^H &= ~$hint_bits;
}
sub AUTOLOAD {
@@ -199,6 +203,11 @@ otherwise returns true.
# with ord 0x100. Since these bytes aren't
# legal UTF-EBCDIC, on EBCDIC platforms, $x is
# unchanged and the function returns FALSE.
+ my $y = "\xc3\x83\xc2\xab"; This has been encoded twice; this
+ # example is only for ASCII platforms
+ utf8::decode($y); # Converts $y to \xc3\xab, returns TRUE;
+ utf8::decode($y); # Further converts to \xeb, returns TRUE;
+ utf8::decode($y); # Returns FALSE, leaves $y unchanged
B<Note that this function does not handle arbitrary encodings>;
use L<Encode> instead.