[perldocjp-cvs 2205] CVS update: docs/modules/utf8-1.08

Back to archive index
argra****@users***** argra****@users*****
2019年 12月 18日 (水) 01:56:14 JST


Date:	Wednesday December 18, 2019 @ 01:56
Author:	argrath

Update of /cvsroot/perldocjp/docs/modules/utf8-1.08
In directory sf-cvs:/tmp/cvs-serv112566/modules/utf8-1.08

Added Files:
	utf8.pod 
Log Message:
utf8-1.08
===================================================================
File: utf8.pod         	Status: Up-to-date

   Working revision:	1.1	Tue Dec 17 16:56:14 2019
   Repository revision:	1.1	/cvsroot/perldocjp/docs/modules/utf8-1.08/utf8.pod,v

   Existing Tags:
	No Tags Exist

-------------- next part --------------
Index: docs/modules/utf8-1.08/utf8.pod
diff -u /dev/null docs/modules/utf8-1.08/utf8.pod:1.1
--- /dev/null	Wed Dec 18 01:56:14 2019
+++ docs/modules/utf8-1.08/utf8.pod	Wed Dec 18 01:56:14 2019
@@ -0,0 +1,447 @@
+
+=encoding euc-jp
+
+=head1 NAME
+
+=begin original
+
+utf8 - Perl pragma to enable/disable UTF-8 (or UTF-EBCDIC) in source code
+
+=end original
+
+utf8 - ¥½¡¼¥¹¥³¡¼¥ÉÆâ¤Î UTF-8(¤Þ¤¿¤Ï UTF-EBCDIC) ¤òÍ­¸ú/̵¸ú¤Ë¤¹¤ë¤¿¤á¤Î¥×¥é¥°¥Þ
+
+=head1 SYNOPSIS
+
+    use utf8;
+    no utf8;
+
+    # Convert the internal representation of a Perl scalar to/from UTF-8.
+
+    $num_octets = utf8::upgrade($string);
+    $success    = utf8::downgrade($string[, FAIL_OK]);
+
+    # Change each character of a Perl scalar to/from a series of
+    # characters that represent the UTF-8 bytes of each original character.
+
+    utf8::encode($string);  # "\x{100}"  becomes "\xc4\x80"
+    utf8::decode($string);  # "\xc4\x80" becomes "\x{100}"
+
+    $flag = utf8::is_utf8(STRING); # since Perl 5.8.1
+    $flag = utf8::valid(STRING);
+
+=head1 DESCRIPTION
+
+=begin original
+
+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
+the source text as literal bytes in the current lexical scope.
+
+=end original
+
+C<use utf8> ¥×¥é¥°¥Þ¤Ï¡¢Perl ¥Ñ¡¼¥µ¡¼¤Ë¡¢¸½ºß¤Î¥ì¥­¥·¥«¥ë¥¹¥³¡¼¥×Æâ¤Î
+¥×¥í¥°¥é¥à¤Î¥Æ¥­¥¹¥È¤Ë UTF-8(EBCDIC ¥Ù¡¼¥¹¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ê¤é¡¢UTF-EBCDIC)
+¤òµö¤¹¤è¤¦¤ËÅÁ¤¨¤Þ¤¹¡£
+C<no utf8> ¥×¥é¥°¥Þ¤Ï Perl ¤Ë¡¢¸½ºß¤Î¥ì¥­¥·¥«¥ë¥¹¥³¡¼¥×¤Î¥½¡¼¥¹¥Æ¥­¥¹¥È¤ò
+¥ê¥Æ¥é¥ë¤Ê¥Ð¥¤¥È¤È¤·¤Æ°·¤¦¤è¤¦¤ËÅÁ¤¨¤Þ¤¹¡£
+
+=begin original
+
+B<Do not use this pragma for anything else than telling Perl that your
+script is written in UTF-8.> The utility functions described below are
+directly usable without C<use utf8;>.
+
+=end original
+
+B<¥¹¥¯¥ê¥×¥È¤¬ UTF-8 ¤Ç½ñ¤«¤ì¤Æ¤¤¤ë¤È¤¤¤¦¤³¤È¤ò Perl ¤Ë¶µ¤¨¤ëÌÜŪ°Ê³°¤Ç
+¤³¤Î¥×¥é¥°¥Þ¤ò¤Ä¤«¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£>
+²¼¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô¤Ï¡¢C<use utf8;> ¤Ê¤·¤ÇľÀܻȤ¨¤Þ¤¹¡£
+
+=begin original
+
+Because it is not possible to reliably tell UTF-8 from native 8 bit
+encodings, you need either a Byte Order Mark at the beginning of your
+source code, or C<use utf8;>, to instruct perl.
+
+=end original
+
+¥Í¥¤¥Æ¥£¥Ö¤Ê 8 ¥Ó¥Ã¥È¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤«¤é UTF-8 ¤Ç¤¢¤ë¤È³Î¼Â¤Ë
+ÃΤ餻¤ë¤³¤È¤ÏÉÔ²Äǽ¤Ê¤Î¤Ç¡¢perl ¤ËÃΤ餻¤ë¤¿¤á¤Ë¥½¡¼¥¹¥³¡¼¥É¤ÎÀèƬ¤Ë
+¥Ð¥¤¥È½ç¥Þ¡¼¥¯¤òÃÖ¤¯¤«¡¢C<use utf8;> ¤ò»ØÄꤹ¤ë¤«¤Î¤É¤Á¤é¤«¤¬É¬ÍפǤ¹¡£
+
+=begin original
+
+When UTF-8 becomes the standard source format, this pragma will
+effectively become a no-op.  For convenience in what follows the term
+I<UTF-X> is used to refer to UTF-8 on ASCII and ISO Latin based
+platforms and UTF-EBCDIC on EBCDIC based platforms.
+
+=end original
+
+UTF-8 ¤¬É¸½à¥½¡¼¥¹¥Õ¥©¡¼¥Þ¥Ã¥È¤È¤Ê¤Ã¤¿¤È¤­¤Ë¤Ï¡¢
+¤³¤Î¥×¥é¥°¥Þ¤Ï»ö¼Â¾å²¿¤â¤·¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
+ÍøÊØÀ­¤Î¤¿¤á¤Ë¡¢°Ê²¼¤Ç¤Î I<UTF-X> ¤È¤¤¤¦Ã±¸ì¤Ï¡¢
+ASCII ¤È ISO Latin ¥Ù¡¼¥¹¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Ï UTF-8 ¤ò¼¨¤·¡¢
+EBCDIC ¥Ù¡¼¥¹¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Ï UTF-EBCDIC ¤ò¼¨¤¹¤â¤Î¤È¤·¤Þ¤¹¡£
+
+=begin original
+
+See also the effects of the C<-C> switch and its cousin, the
+C<$ENV{PERL_UNICODE}>, in L<perlrun>.
+
+=end original
+
+L<perlrun> ¤Ë¤¢¤ë¡¢C<-C> ¥¹¥¤¥Ã¥ÁµÚ¤Ó¤½¤Î¤¤¤È¤³¤Î C<$ENV{PERL_UNICODE}> ¤Î
+¸ú²Ì¤â»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+=begin original
+
+Enabling the C<utf8> pragma has the following effect:
+
+=end original
+
+C<utf8> ¥×¥é¥°¥Þ¤òÍ­¸ú¤Ë¤¹¤ë¤È¼¡¤Î¸ú²Ì¤¬¤¢¤ê¤Þ¤¹:
+
+=over 4
+
+=item *
+
+=begin original
+
+Bytes in the source text that have their high-bit set will be treated
+as being part of a literal UTF-X sequence.  This includes most
+literals such as identifier names, string constants, and constant
+regular expression patterns.
+
+=end original
+
+¹â¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¡¢¥½¡¼¥¹¥Æ¥­¥¹¥È¤Ë¤¢¤ë¥Ð¥¤¥È¤Ï¡¢
+¥ê¥Æ¥é¥ë¤Î UTF-X ¥·¡¼¥±¥ó¥¹¤ÎÉôʬ¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£
+¤³¤Î¤³¤È¤Ï¡¢¤Û¤È¤ó¤É¤Î¥ê¥Æ¥é¥ë¡¢¼±Ê̻ҤÎ̾Á°¡¢
+ʸ»úÎóÄê¿ô¡¢Àµµ¬É½¸½¥Ñ¥¿¡¼¥óÄê¿ô¤â´Þ¤ß¤Þ¤¹¡£
+
+=begin original
+
+On EBCDIC platforms characters in the Latin 1 character set are
+treated as being part of a literal UTF-EBCDIC character.
+
+=end original
+
+EBCDIC ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Ï¡¢Latin 1 ʸ»ú½¸¹ç¤Îʸ»ú¤Ï¡¢
+¥ê¥Æ¥é¥ë¤Î UTF-EBCDIC ¤Îʸ»ú¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£
+
+=back
+
+=begin original
+
+Note that if you have bytes with the eighth bit on in your script
+(for example embedded Latin-1 in your string literals), C<use utf8>
+will be unhappy since the bytes are most probably not well-formed
+UTF-X.  If you want to have such bytes under C<use utf8>, you can disable
+this pragma until the end the block (or file, if at top level) by
+C<no utf8;>.
+
+=end original
+
+¥¹¥¯¥ê¥×¥ÈÆâ¤Ë 8 ¥Ó¥Ã¥È¤Î¥Ð¥¤¥ÈÎ󤬤¢¤ë(¤¿¤È¤¨¤Ð¡¢Ê¸»úÎó¥ê¥Æ¥é¥ë¤Ë
+Latin-1 ¤¬¤¢¤ë)¤Ê¤é¡¢C<use utf8> ¤ÏÉÔ¹¬¤ò¤â¤¿¤é¤¹¤Ç¤·¤ç¤¦;
+¥Ð¥¤¥ÈÎó¤Ï¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢Å¬ÀÚ¤Ê UTF-X ¤Ç¤Ï¤Ê¤¤¤«¤é¤Ç¤¹¡£
+C<use utf8> Æâ¤Ç¤½¤Î¤è¤¦¤Ê¥Ð¥¤¥ÈÎó¤ò»È¤¤¤¿¤¤¾ì¹ç¤Ï¡¢¥Ö¥í¥Ã¥¯(¤Þ¤¿¤Ï¡¢
+ºÇ¾åÉô¤Ë½ñ¤±¤Ð¡¢¥Õ¥¡¥¤¥ë)¤Î½ª¤ï¤ê¤Þ¤Ç¡¢C<no utf8;> ¤Ç¡¢utf8 ¤ò
+̵¸ú¤Ë¤Ç¤­¤Þ¤¹¡£
+
+=head2 Utility functions
+
+(¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô)
+
+=begin original
+
+The following functions are defined in the C<utf8::> package by the
+Perl core.  You do not need to say C<use utf8> to use these and in fact
+you should not say that  unless you really want to have UTF-8 source code.
+
+=end original
+
+²¼µ­¤Î´Ø¿ô¤Ï¡¢Perl core ¤Ë¤è¤Ã¤Æ¡¢C<utf8::> ¥Ñ¥Ã¥±¡¼¥¸¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
+¤³¤ì¤é¤Î´Ø¿ô¤ò»È¤¦¤Î¤Ë¡¢C<use utf8> ¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¤·¡¢
+¼ÂºÝ¡¢ËÜÅö¤Ë UTF-8 ¤Î¥½¡¼¥¹¥³¡¼¥É¤ò½ñ¤³¤¦¤È¤¹¤ë¤Î¤Ç¤Ê¤¤¤Ê¤é¡¢
+C<use utf8> ¤¹¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
+
+=over 4
+
+=item * $num_octets = utf8::upgrade($string)
+
+=begin original
+
+Converts in-place the internal representation of the string from an octet
+sequence in the native encoding (Latin-1 or EBCDIC) to I<UTF-X>. The
+logical character sequence itself is unchanged.  If I<$string> is already
+stored as I<UTF-X>, then this is a no-op. Returns the
+number of octets necessary to represent the string as I<UTF-X>.  Can be
+used to make sure that the UTF-8 flag is on, so that C<\w> or C<lc()>
+work as Unicode on strings containing characters in the range 0x80-0xFF
+(on ASCII and derivatives).
+
+=end original
+
+ʸ»úÎó¤ÎÆâÉôɽ¸½¤ò¡¢¥Í¥¤¥Æ¥£¥Ö¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° (Latin-1 ¤ä EBCDIC) ¤Î
+¥ª¥¯¥Æ¥Ã¥È¥·¡¼¥±¥ó¥¹¤«¤é I<UTF-X> ¤Ë¤½¤Î¾ì¤ÇÊÑ´¹¤·¤Þ¤¹¡£
+ÏÀÍýŪ¤Êʸ»úʤӼ«¿È¤ÏÊѹ¹¤µ¤ì¤Þ¤»¤ó¡£
+I<$string> ¤¬´û¤Ë I<UTF-X> ¤È¤·¤ÆÊݴɤµ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï²¿¤â¤·¤Þ¤»¤ó¡£
+I<UTF-X> ¤È¤·¤Æ¡¢Ê¸»úÎó¤òɽ¸½¤¹¤ë¤Î¤ËɬÍפʥª¥¯¥Æ¥Ã¥È¤Î¿ô¤òÊÖ¤·¤Þ¤¹¡£
+UTF-8 ¥Õ¥é¥°¤¬¥ª¥ó¤Ç¤¢¤ë¤³¤È¤ò³Îǧ¤¹¤ë¤Î¤Ë»È¤¨¤Þ¤¹;
+¤Ç¤¹¤Î¤Ç¡¢C<\w> ¤ä C<lc()> ¤Ï¡¢(ASCII ¤È¤½¤ÎÇÉÀ¸¤Ç¤Ï) 0x80-0xFF ¤Î
+ʸ»ú¤ò´Þ¤àʸ»úÎó¤Ç´üÂÔ¤µ¤ì¤ë¤è¤¦¤ËÆ°¤­¤Þ¤¹¡£
+
+=begin original
+
+B<Note that this function does not handle arbitrary encodings.>
+Therefore Encode is recommended for the general purposes; see also
+L<Encode>.
+
+=end original
+
+B<¤³¤Î´Ø¿ô¤Ï¡¢Ç¤°Õ¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò°·¤¨¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤³¤È¤Ë
+Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£>
+½¾¤Ã¤Æ¡¢°ìÈÌŪ¤ÊÍÑÅÓ¤Ç¤Ï Encode ¤ò¿ä¾©¤·¤Þ¤¹; L<Encode> ¤â
+»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+=item * $success = utf8::downgrade($string[, FAIL_OK])
+
+=begin original
+
+Converts in-place the the internal representation of the string from
+I<UTF-X> to the equivalent octet sequence in the native encoding (Latin-1
+or EBCDIC). The logical character sequence itself is unchanged. If
+I<$string> is already stored as native 8 bit, then this is a no-op.  Can
+be used to
+make sure that the UTF-8 flag is off, e.g. when you want to make sure
+that the substr() or length() function works with the usually faster
+byte algorithm.
+
+=end original
+
+ʸ»úÎó¤ÎÆâÉôɽ¸½¤ò¡¢I<UTF-X> ¤«¤éÅù²Á¤Ê¥Í¥¤¥Æ¥£¥Ö¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°
+(Latin-1 ¤ä EBCDIC) ¤ÎÆâÉô¥ª¥¯¥Æ¥Ã¥È¥·¡¼¥±¥ó¥¹¤Ë¤½¤Î¾ì¤ÇÊÑ´¹¤·¤Þ¤¹¡£
+ÏÀÍýŪ¤Êʸ»úʤӼ«¿È¤ÏÊѹ¹¤µ¤ì¤Þ¤»¤ó¡£
+I<$string> ¤¬´û¤Ë¥Í¥¤¥Æ¥£¥Ö¤Ê 8 ¥Ó¥Ã¥È¤È¤·¤ÆÊݴɤµ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï
+²¿¤â¤·¤Þ¤»¤ó¡£
+¤¿¤È¤¨¤Ð¡¢substr() ¤ä length() ´Ø¿ô¤¬¡¢
+Ä̾ï¤Ï¤è¤ê®¤¤¥Ð¥¤¥È¥¢¥ë¥´¥ê¥º¥à¤ÇÆ°¤¯¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¡¢
+UTF-8¥Õ¥é¥°¤¬¥ª¥Õ¤Ç¤¢¤ë¤Î¤ò³Îǧ¤¹¤ë¤Î¤Ë»È¤¨¤Þ¤¹¡£
+
+=begin original
+
+Fails if the original I<UTF-X> sequence cannot be represented in the
+native 8 bit encoding. On failure dies or, if the value of C<FAIL_OK> is
+true, returns false. 
+
+=end original
+
+¸µ¤Î I<UTF-X> ¥·¡¼¥±¥ó¥¹¤¬¥Í¥¤¥Æ¥£¥Ö¤Ê 8 ¥Ó¥Ã¥È¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ç
+ɽ¸½¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¼ºÇÔ¤·¤Þ¤¹¡£
+¼ºÇÔ¤·¤¿¤È¤­¤Ë¤Ï¡¢C<FAIL_OK> ¤ÎÃͤ¬¿¿¤Î¾ì¹ç¤Ïµ¶¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï
+die ¤·¤Þ¤¹¡£
+
+=begin original
+
+Returns true on success.
+
+=end original
+
+À®¸ù¤¹¤ë¤È¿¿¤òÊÖ¤·¤Þ¤¹¡£
+
+=begin original
+
+B<Note that this function does not handle arbitrary encodings.>
+Therefore Encode is recommended for the general purposes; see also
+L<Encode>.
+
+=end original
+
+B<¤³¤Î´Ø¿ô¤Ï¡¢Ç¤°Õ¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò°·¤¨¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤³¤È¤Ë
+Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£>
+½¾¤Ã¤Æ¡¢°ìÈÌŪ¤ÊÍÑÅÓ¤Ç¤Ï Encode ¤ò¿ä¾©¤·¤Þ¤¹; L<Encode> ¤â
+»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+=item * utf8::encode($string)
+
+=begin original
+
+Converts in-place the character sequence to the corresponding octet
+sequence in I<UTF-X>. That is, every (possibly wide) character gets
+replaced with a sequence of one or more characters that represent the
+individual I<UTF-X> bytes of the character.  The UTF8 flag is turned off.
+Returns nothing.
+
+=end original
+
+ʸ»ú¥·¡¼¥±¥ó¥¹¤ò¡¢Âбþ¤¹¤ë I<UTF-X> ¤Î¥ª¥¯¥Æ¥Ã¥È¥·¡¼¥±¥ó¥¹¤Ë
+¤½¤Î¾ì¤ÇÊÑ´¹¤·¤Þ¤¹¡£
+¤Ä¤Þ¤ê¡¢¤½¤ì¤¾¤ì¤Î(¥ï¥¤¥É¤«¤â¤·¤ì¤Ê¤¤)ʸ»ú¤Ï¡¢¸Ä¡¹¤Î I<UTF-X> ¥Ð¥¤¥È¤Î
+ʸ»ú¤òɽ¸½¤¹¤ë°ì¤Ä°Ê¾å¤Îʸ»ú¤ÎʤӤËÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£
+UTF8 ¥Õ¥é¥°¤Ï¥ª¥Õ¤Ë¤Ê¤ê¤Þ¤¹¡£
+²¿¤âÊÖ¤·¤Þ¤»¤ó¡£
+
+    my $a = "\x{100}"; # $a contains one character, with ord 0x100
+    utf8::encode($a);  # $a contains two characters, with ords 0xc4 and 0x80
+
+=begin original
+
+B<Note that this function does not handle arbitrary encodings.>
+Therefore Encode is recommended for the general purposes; see also
+L<Encode>.
+
+=end original
+
+B<¤³¤Î´Ø¿ô¤Ï¡¢Ç¤°Õ¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò°·¤¨¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤³¤È¤Ë
+Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£>
+½¾¤Ã¤Æ¡¢°ìÈÌŪ¤ÊÍÑÅÓ¤Ç¤Ï Encode ¤ò¿ä¾©¤·¤Þ¤¹; L<Encode> ¤â
+»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+=item * $success = utf8::decode($string)
+
+=begin original
+
+Attempts to convert in-place the octet sequence in I<UTF-X> to the
+corresponding character sequence. That is, it replaces each sequence of
+characters in the string whose ords represent a valid UTF-X byte
+sequence, with the corresponding single character.  The UTF-8 flag is
+turned on only if the source string contains multiple-byte I<UTF-X>
+characters.  If I<$string> is invalid as I<UTF-X>, returns false;
+otherwise returns true.
+
+=end original
+
+I<UTF-X> ¤Î¥ª¥¯¥Æ¥Ã¥È¥·¡¼¥±¥ó¥¹¤ò¡¢Âбþ¤¹¤ëʸ»ú¥·¡¼¥±¥ó¥¹¤Ë
+ŬÀÚ¤ËÊÑ´¹¤·¤è¤¦¤È¤·¤Þ¤¹¡£
+UTF-8 ¥Õ¥é¥°¤Ï¡¢¸µ¤Îʸ»úÎó¤¬Ê£¿ô¥Ð¥¤¥È¤Î I<UTF-X> ʸ»ú¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Ë¤Î¤ß
+¥ª¥ó¤Ë¤Ê¤ê¤Þ¤¹¡£
+¤â¤· I<$string> ¤¬ I<UTF-X> ¤È¤·¤ÆÉÔÀµ¤Ê¤é¡¢µ¶¤òÊÖ¤·¤Þ¤¹;
+¤µ¤â¤Ê¤±¤ì¤Ð¿¿¤òÊÖ¤·¤Þ¤¹¡£
+
+    my $a = "\xc4\x80"; # $a contains two characters, with ords 0xc4 and 0x80
+    utf8::decode($a);   # $a contains one character, with ord 0x100
+
+=begin original
+
+B<Note that this function does not handle arbitrary encodings.>
+Therefore Encode is recommended for the general purposes; see also
+L<Encode>.
+
+=end original
+
+B<¤³¤Î´Ø¿ô¤Ï¡¢Ç¤°Õ¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤ò°·¤¨¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤³¤È¤Ë
+Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£>
+½¾¤Ã¤Æ¡¢°ìÈÌŪ¤ÊÍÑÅÓ¤Ç¤Ï Encode ¤ò¿ä¾©¤·¤Þ¤¹; L<Encode> ¤â
+»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
+
+=item * $flag = utf8::is_utf8(STRING)
+
+=begin original
+
+(Since Perl 5.8.1)  Test whether STRING is in UTF-8 internally.
+Functionally the same as Encode::is_utf8().
+
+=end original
+
+(Perl 5.8.1 ¤«¤é) STRING ¤¬¡¢ÆâÉôŪ¤Ë UTF-8 ¤«¤É¤¦¤«¤ò¥Æ¥¹¥È¤·¤Þ¤¹¡£
+µ¡Ç½Åª¤Ë¤Ï¡¢Encode::is_utf8() ¤ÈƱ¤¸¤Ç¤¹¡£
+
+=item * $flag = utf8::valid(STRING)
+
+=begin original
+
+[INTERNAL] Test whether STRING is in a consistent state regarding
+UTF-8.  Will return true is well-formed UTF-8 and has the UTF-8 flag
+on B<or> if string is held as bytes (both these states are 'consistent').
+Main reason for this routine is to allow Perl's testsuite to check
+that operations have left strings in a consistent state.  You most
+probably want to use utf8::is_utf8() instead.
+
+=end original
+
+[ÆâÉô´Ø¿ô] STRING ¤¬ UTF-8 ¤È¤·¤Æ°ì´Ó¤·¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤Þ¤¹¡£
+STRING ¤¬ well-formed UTF-8 ¤Ç UTF-8 ¥Õ¥é¥°¤¬¥ª¥ó¤Î¾ì¹ç B<¤Þ¤¿¤Ï>
+ʸ»úÎ󤬥Х¤¥È¤È¤·¤ÆÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¿¿¤òÊÖ¤·¤Þ¤¹
+(ξÊý¤È¤â¾õÂ֤ϡְì´Ó¤·¤Æ¡×¤¤¤Þ¤¹)¡£
+¤³¤Î¥ë¡¼¥Á¥ó¤Î¼çÌÜŪ¤Ï¡¢
+¤¢¤ëÁàºî¤¬Ê¸»úÎó¤ò°ì´Ó¤·¤¿¾õÂÖ¤ËÊݤäƤ¤¤ë¤«¤ò Perl ¤Î¥Æ¥¹¥È¥¹¥¤¡¼¥È¤¬
+Ä´¤Ù¤é¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¤Ç¤¹¡£
+¤ª¤½¤é¤¯¤¿¤¤¤Æ¤¤¤Î¾ì¹ç¤ÏÂå¤ï¤ê¤Ë utf8::is_utf8() ¤ò»È¤¤¤¿¤¤¤Ï¤º¤Ç¤¹¡£
+
+=back
+
+=begin original
+
+C<utf8::encode> is like C<utf8::upgrade>, but the UTF8 flag is
+cleared.  See L<perlunicode> for more on the UTF8 flag and the C API
+functions C<sv_utf8_upgrade>, C<sv_utf8_downgrade>, C<sv_utf8_encode>,
+and C<sv_utf8_decode>, which are wrapped by the Perl functions
+C<utf8::upgrade>, C<utf8::downgrade>, C<utf8::encode> and
+C<utf8::decode>.  Also, the functions utf8::is_utf8, utf8::valid,
+utf8::encode, utf8::decode, utf8::upgrade, and utf8::downgrade are
+actually internal, and thus always available, without a C<require utf8>
+statement.
+
+=end original
+
+C<utf8::encode> ¤Ï¡¢C<utf8::upgrade> ¤Ë»÷¤Æ¤¤¤Þ¤¹¤¬¡¢UTF8 ¥Õ¥é¥°¤¬
+ºï½ü¤µ¤ì¤Þ¤¹¡£
+UTF8 ¥Õ¥é¥°¤Î¾ÜºÙ¤ª¤è¤Ó¡¢Perl ´Ø¿ô¤Î C<utf8::upgrade>,
+C<utf8::downgrade>, C<utf8::encode>, C<utf8::decode> ¤Ç¥é¥Ã¥Ô¥ó¥°¤µ¤ì¤Æ¤¤¤ë
+C API ´Ø¿ô C<sv_utf8_upgrade>, C<sv_utf8_downgrade>,
+C<sv_utf8_encode>, C<sv_utf8_decode> ¤Ë¤Ä¤¤¤Æ¤Ï L<perlunicode> ¤ò
+»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
+¤Þ¤¿¡¢utf8::is_utf8, utf8::valid,
+utf8::encode, utf8::decode, utf8::upgrade, utf8::downgrade ¤Ï¡¢
+¼ÂºÝ¤Ë¤ÏÆâÉô´Ø¿ô¤Ê¤Î¤Ç¡¢¾ï¤Ë C<require utf8> ¤Ê¤·¤ÇÍøÍѲÄǽ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
+
+=head1 BUGS
+
+=begin original
+
+One can have Unicode in identifier names, but not in package/class or
+subroutine names.  While some limited functionality towards this does
+exist as of Perl 5.8.0, that is more accidental than designed; use of
+Unicode for the said purposes is unsupported.
+
+=end original
+
+¼±Ê̻ҤÎ̾Á°¤È¤·¤Æ Unicode ¤ò»È¤¨¤Þ¤¹¤¬¡¢¥Ñ¥Ã¥±¡¼¥¸/¥¯¥é¥¹¤ä
+¥µ¥Ö¥ë¡¼¥Á¥ó¤Î̾Á°¤È¤·¤Æ¤Ï»È¤¨¤Þ¤»¤ó¡£
+Perl 5.8.0 ¤«¤é¤Ï¤³¤ì¤Ë´Ø¤¹¤ë¸ÂÄꤵ¤ì¤¿µ¡Ç½¤¬Â¸ºß¤·¤Þ¤¹¤¬¡¢
+¤³¤ì¤é¤ÏͽÄꤵ¤ì¤¿¤â¤Î¤È¤¤¤¦¤è¤ê¤Ï¶öÁ³¤Î»ºÊª¤Ç¤¹;
+¤³¤Î¤è¤¦¤ÊÌÜŪ¤Ç Unicode ¤ò»È¤¦¤³¤È¤ÏÈ󥵥ݡ¼¥È¤Ç¤¹¡£
+
+=begin original
+
+One reason of this unfinishedness is its (currently) inherent
+unportability: since both package names and subroutine names may need
+to be mapped to file and directory names, the Unicode capability of
+the filesystem becomes important-- and there unfortunately aren't
+portable answers.
+
+=end original
+
+¤³¤ÎÉÔ´°Á´À­¤Î¸¶°ø¤Î°ì¤Ä¤Ï(¸½ºß¤Î¤È¤³¤í)ÀèŷŪ¤ÊÈó°Ü¿¢À­¤Ç¤¹;
+¥Ñ¥Ã¥±¡¼¥¸Ì¾¤È¥µ¥Ö¥ë¡¼¥Á¥ó̾¤Ï¤½¤ì¤¾¤ì¥Õ¥¡¥¤¥ë¤È¥Ç¥£¥ì¥¯¥È¥ê̾¤Ë
+ÂбþÉÕ¤±¤é¤ì¤ëɬÍפ¬¤¢¤ë¤Î¤Ç¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î Unicode Âбþ¤¬
+½ÅÍפȤʤê¤Þ¤¹ -- ¤½¤·¤Æ»ÄÇ°¤Ê¤¬¤é°Ü¿¢À­¤Î¤¢¤ëÅú¤¨¤¬Â¸ºß¤·¤Þ¤»¤ó¡£
+
+=head1 SEE ALSO
+
+L<perlunitut>, L<perluniintro>, L<perlrun>, L<bytes>, L<perlunicode>
+
+=begin meta
+
+Translate: Ktat <ktat****@kawac*****>
+Update: Kentaro Shirakata <argra****@ub32*****> (1.07-)
+Status: completed
+
+=end meta
+
+=cut
+


perldocjp-cvs メーリングリストの案内
Back to archive index