From: Stas Bekman Date: Sat, 16 Aug 2003 13:30:28 +0000 (-0700) Subject: [patch lib/utf8.pm] doc tweaks X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=973655a88ba1f882d9a8d56f00354b4569cbad10;p=p5sagit%2Fp5-mst-13.2.git [patch lib/utf8.pm] doc tweaks Message-ID: <3F3E9464.3030202@stason.org> p4raw-id: //depot/perl@20735 --- diff --git a/lib/utf8.pm b/lib/utf8.pm index 986d577..5f7e635 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 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 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 encoding into logical characters. Returns nothing. Same as Encode::decode_utf8().