diff options
author | Stas Bekman <stas@stason.org> | 2003-08-16 06:30:28 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-08-16 19:39:39 +0000 |
commit | 973655a88ba1f882d9a8d56f00354b4569cbad10 (patch) | |
tree | 578e516de161ba7ac26beb7f90f5acb5cc2da89d /lib/utf8.pm | |
parent | 3ee63918b283f8dc009c331f172f83c394ed2bb6 (diff) | |
download | perl-973655a88ba1f882d9a8d56f00354b4569cbad10.tar.gz |
[patch lib/utf8.pm] doc tweaks
Message-ID: <3F3E9464.3030202@stason.org>
p4raw-id: //depot/perl@20735
Diffstat (limited to 'lib/utf8.pm')
-rw-r--r-- | lib/utf8.pm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/utf8.pm b/lib/utf8.pm index 986d577821..5f7e6354f1 100644 --- a/lib/utf8.pm +++ b/lib/utf8.pm @@ -2,7 +2,7 @@ package utf8; $utf8::hint_bits = 0x00800000; -our $VERSION = '1.01'; +our $VERSION = '1.02'; sub import { $^H |= $utf8::hint_bits; @@ -31,6 +31,15 @@ utf8 - Perl pragma to enable/disable UTF-8 (or UTF-EBCDIC) in source code use utf8; no utf8; + $num_octets = utf8::upgrade($string); + $success = utf8::downgrade($string[, FAIL_OK]); + + utf8::encode($string); + utf8::decode($string); + + $flag = utf8::is_utf8(STRING); + $flag = utf8::valid(STRING); + =head1 DESCRIPTION The C<use utf8> pragma tells the Perl parser to allow UTF-8 in the @@ -78,7 +87,7 @@ you should not unless you really want to have UTF-8 source code. =over 4 -=item * $num_octets = utf8::upgrade($string); +=item * $num_octets = utf8::upgrade($string) Converts (in-place) internal representation of string to Perl's internal I<UTF-X> form. Returns the number of octets necessary to @@ -89,7 +98,7 @@ derivatives). Note that this should not be used to convert a legacy byte encoding to Unicode: use Encode for that. Affected by the encoding pragma. -=item * utf8::downgrade($string[, FAIL_OK]) +=item * $success = utf8::downgrade($string[, FAIL_OK]) Converts (in-place) internal representation of string to be un-encoded bytes. Returns true on success. On failure dies or, if the value of @@ -108,7 +117,7 @@ nothing. Same as Encode::encode_utf8(). Note that this should not be used to convert a legacy byte encoding to Unicode: use Encode for that. -=item * $flag = utf8::decode($string) +=item * utf8::decode($string) Attempts to convert I<$string> in-place from Perl's I<UTF-X> encoding into logical characters. Returns nothing. Same as Encode::decode_utf8(). |