summaryrefslogtreecommitdiff
path: root/lib/utf8.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-03-19 14:50:02 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-19 14:50:02 +0000
commit70122e76257dbc4db6646e95d379adb28c9a38b5 (patch)
treed0faad83604c3109f19701b09fb5d56e9a5adcc1 /lib/utf8.pm
parent38a64d231e64d67db540a119c58cb9221a637ba6 (diff)
downloadperl-70122e76257dbc4db6646e95d379adb28c9a38b5.tar.gz
Integrate perlio:
[ 15314] Move docs for Encode::valid_utf8 (which does not exist) to be docs for utf8::valid() (which does). p4raw-link: @15314 on //depot/perlio: 5463e635e29aad1605d20ed3ea9f8b3e487e0102 p4raw-id: //depot/perl@15322 p4raw-integrated: from //depot/perlio@15321 'copy in' lib/utf8.pm (@15196..) 'merge in' ext/Encode/Encode.pm (@15274..)
Diffstat (limited to 'lib/utf8.pm')
-rw-r--r--lib/utf8.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/utf8.pm b/lib/utf8.pm
index 9023eb6eb2..5bec95514a 100644
--- a/lib/utf8.pm
+++ b/lib/utf8.pm
@@ -35,7 +35,7 @@ utf8 - Perl pragma to enable/disable UTF-8 (or UTF-EBCDIC) in source code
The C<use utf8> pragma tells the Perl parser to allow UTF-8 in the
program text in the current lexical scope (allow UTF-EBCDIC on EBCDIC based
-platforms). The C<no utf8> pragma tells Perl to switch back to treating
+platforms). The C<no utf8> pragma tells Perl to switch back to treating
the source text as literal bytes in the current lexical scope.
This pragma is primarily a compatibility device. Perl versions
@@ -103,6 +103,14 @@ Attempts to convert I<$string> in-place from Perl's I<UTF-X> encoding
into logical characters. Note that this should not be used to convert
Unicode back to a legacy byte encoding: use Encode for that.
+=item * $flag = utf8::valid(STRING)
+
+[INTERNAL] Test whether STRING is in a consistent state. Will return
+true if string is held as bytes, or is well-formed UTF-8 and has the
+UTF-8 flag on. Main reason for this routine is to allow Perl's
+testsuite to check that operations have left strings in a consistent
+state.
+
=back
C<utf8::encode> is like C<utf8::upgrade>, but the UTF8 flag is cleared.