Change 13421 by jhi@alpha on 2001/12/02 00:25:35

        encode()/decode() examples.

Affected files ...

.... //depot/perl/ext/Encode/Encode.pm#51 edit

Differences ...

==== //depot/perl/ext/Encode/Encode.pm#51 (text) ====
Index: perl/ext/Encode/Encode.pm
--- perl/ext/Encode/Encode.pm.~1~       Sat Dec  1 17:30:05 2001
+++ perl/ext/Encode/Encode.pm   Sat Dec  1 17:30:05 2001
@@ -700,6 +700,11 @@
 Encodes string from Perl's internal form into I<ENCODING> and returns
 a sequence of octets.  For CHECK see L</"Handling Malformed Data">.
 
+For example to convert (internally UTF-8 encoded) Unicode data
+to octets:
+
+       $octets = encode("utf8", $unicode);
+
 =item *
 
         $string = decode(ENCODING, $bytes[, CHECK])
@@ -708,6 +713,10 @@
 internal form and returns the resulting string.  For CHECK see
 L</"Handling Malformed Data">.
 
+For example to convert ISO 8859-1 data to UTF-8:
+
+       $utf8 = decode("latin1", $latin1);
+
 =item *
 
        from_to($string, FROM_ENCODING, TO_ENCODING[, CHECK])
End of Patch.

Reply via email to