argra****@users*****
argra****@users*****
2008年 6月 12日 (木) 04:59:15 JST
Index: docs/perl/5.10.0/perluniintro.pod diff -u docs/perl/5.10.0/perluniintro.pod:1.2 docs/perl/5.10.0/perluniintro.pod:1.3 --- docs/perl/5.10.0/perluniintro.pod:1.2 Thu Jun 5 16:33:43 2008 +++ docs/perl/5.10.0/perluniintro.pod Thu Jun 12 04:59:15 2008 @@ -544,13 +544,12 @@ =end original -In any case, the Unicode support on EBCDIC platforms is better than -in the 5.6 series, which didn't work much at all for EBCDIC platform. -On EBCDIC platforms, the internal Unicode encoding form is UTF-EBCDIC -instead of UTF-8. The difference is that as UTF-8 is "ASCII-safe" in -that ASCII characters encode to UTF-8 as-is, while UTF-EBCDIC is -"EBCDIC-safe". -(TBT) +ともかく、EBCDIC プラットフォームでの Unicode 対応は、EBCDIC プラットフォームでは +うまく動かなかった 5.6 シリーズよりは改善しえいます。 +EBCDIC プラットフォームでは、内部 Unicode エンコーディング形式は +UTF-8 ではなく UTF-EBCDIC です。 +この違いは、ASCII 文字はそのまま UTF-8 にエンコードされるという点において +"ASCII セーフ" ですが、一方 UTF-EBCDIC は "EBCDIC セーフ" です。 =head2 Creating Unicode @@ -1199,7 +1198,7 @@ =end original -Unicode 文字を内部的にエンコーディングする、内側を覗き見る 1 つの方法は、 +Unicode 文字の内部エンコーディングの内側を覗き見る方法の 1 つは、 C<unpack("C*", ...> を使い、to get the bytes of whatever the string encoding happens to be, or C<unpack("U0..", ...)> to get the bytes of the UTF-8 encoding: @@ -1663,8 +1662,8 @@ =end original 妥当でなければ、C<Malformed UTF-8 character> の警告が出ます。 -"C0" は、"process the string character per character" ことを意味します。 -それ以外では、C<unpack("U*", ...)>が、would work in C<U0> mode (the default if the format +"C0" は、「文字列を文字単位で処理する」ことを意味します。 +それ以外では、C<unpack("U*", ...)> が、would work in C<U0> mode (the default if the format string starts with C<U>) and it would return the bytes making up the UTF-8 encoding of the target string, something that will always work. (TBT) @@ -1699,11 +1698,11 @@ =end original -In one sense, what you are asking doesn't make much sense: encodings -are for characters, and binary data are not "characters", so converting -"data" into some encoding isn't meaningful unless you know in what -character set and encoding the binary data is in, in which case it's -not just binary data, now is it? +In one sense, what you are asking doesn't make much sense: +エンコーディングは文字のためのもので、バイナリデータは「文字」ではないので、 +「データ」を何かのエンコーディングに変換するということは、 +バイナリデータの文字セットとエンコーディングが分かっていない限り無意味です; +そして分かっているならそれは単なるバイナリデータではないですよね? (TBT) =begin original @@ -1713,9 +1712,8 @@ =end original -If you have a raw sequence of bytes that you know should be -interpreted via a particular encoding, you can use C<Encode>: -(TBT) +どのエンコーディングで解釈するべきか分かっている生のバイト列がある場合、 +C<Encode> が使えます: use Encode 'from_to'; from_to($data, "iso-8859-1", "utf-8"); # from latin-1 to utf-8 @@ -1732,7 +1730,9 @@ The call to C<from_to()> changes the bytes in C<$data>, but nothing material about the nature of the string has changed as far as Perl is -concerned. Both before and after the call, the string C<$data> +concerned. +呼び出しの前後の両方において、文字列 C<$data> は単に 8 ビットのバイトの +塊です。 contains just a bunch of 8-bit bytes. As far as Perl is concerned, the encoding of the string remains as "system-native 8-bit bytes". (TBT) Index: docs/perl/5.10.0/perlvar.pod diff -u docs/perl/5.10.0/perlvar.pod:1.1 docs/perl/5.10.0/perlvar.pod:1.2 --- docs/perl/5.10.0/perlvar.pod:1.1 Thu May 22 04:58:13 2008 +++ docs/perl/5.10.0/perlvar.pod Thu Jun 12 04:59:15 2008 @@ -860,8 +860,8 @@ =end original -Each filehandle in Perl counts the number of lines that have been read -from it. (Depending on the value of C<$/>, Perl's idea of what +Perl の各ファイルハンドルは、そこから読み込んだ行数を数えています。 +(Depending on the value of C<$/>, Perl's idea of what constitutes a line may not match yours.) When a line is read from a filehandle (via readline() or C<< <> >>), or when tell() or seek() is called on it, C<$.> becomes an alias to the line counter for that @@ -893,8 +893,10 @@ =end original -C<$.> is reset when the filehandle is closed, but B<not> when an open -filehandle is reopened without an intervening close(). For more +C<$.> はファイルハンドルがクローズされるとリセットされますが、 +オープンしているファイルハンドルが close() されることなく再オープンされた +場合にはリセット B<されません>。 +For more details, see L<perlop/"IE<sol>O Operators">. Because C<< <> >> never does an explicit close, line numbers increase across ARGV files (but see examples in L<perlfunc/eof>). @@ -1721,8 +1723,9 @@ =end original 数値として使われると、その時点の C の C<errno> 変数の値が得られます; -or in other words, if a system or library call fails, it -sets this variable. This means that the value of C<$!> is meaningful +言い換えると、もしシステムコールやライブラリ呼び出しが失敗すると、 +この変数がセットされます。 +This means that the value of C<$!> is meaningful only I<immediately> after a B<failure>: (TBT) @@ -1746,8 +1749,9 @@ =end original In the above I<meaningless> stands for anything: zero, non-zero, -C<undef>. A successful system or library call does B<not> set -the variable to zero. +C<undef>. +システムコールやライブラリ呼び出しが成功した場合は、この変数は 0 に +セット B<されません>。 (TBT) =begin original @@ -2049,8 +2053,8 @@ =end original -本プロセスの実 gid を示します。 同時に複数のグループに -所属できるマシンでは、所属するグループをスペースで +本プロセスの実 gid を示します。 +同時に複数のグループに所属できるマシンでは、所属するグループをスペースで 区切ったリストが得られます。 最初の数値は、getgid() で返されるものです。 その後に getgroups() が返す値が続き、その中の 1 つは、 @@ -2256,11 +2260,9 @@ 完全に "perl" の文字列は取り除かれません。 例えば、C<$0> に C<"foobar"> と設定すると、C<"perl: foobar (perl)"> という 結果になります -(whether both the C<"perl: "> prefix -and the " (perl)" suffix are shown depends on your exact BSD variant -and version)。 +(C<"perl: "> 接頭辞と" (perl)" 接尾辞が表示されるかどうかは 、正確な +BSD の種類とバージョンに依存します)。 これはオペレーティングシステムの機能で、Perl は何もできません。 -(TBT) =begin original @@ -2409,9 +2411,8 @@ デバッグフラグの現在の値を示します。 (記憶法: B<-D> スイッチの値。) 読み書き可能です。 -Like its command-line equivalent, you can use -numeric or symbolic values, eg C<$^D = 10> or C<$^D = "st">. -(TBT) +コマンドラインによる等価な機能と同様に、数値とシンボル値が使えます +(例: C<$^D = 10> または C<$^D = "st">)。 =item ${^RE_DEBUG_FLAGS} @@ -2422,9 +2423,10 @@ =end original -The current value of the regex debugging flags. Set to 0 for no debug output -even when the re 'debug' module is loaded. See L<re> for details. -(TBT) +正規表現デバッグフラグの現在の値です。 +0 をセットすると、re 'debug' モジュールが読み込まれていても +デバッグ出力を行いません。 +詳細については L<re> を参照してください。 =item ${^RE_TRIE_MAXBUF} @@ -2700,7 +2702,8 @@ =end original -An internal variable used by PerlIO. A string in two parts, separated +PerlIO で使われる内部変数です。 +A string in two parts, separated by a C<\0> byte, the first part describes the input layers, the second part describes the output layers. (TBT) @@ -2926,7 +2929,8 @@ =end original -Reflects if taint mode is on or off. 1 for on (the program was run with +汚染検査モードのオン・オフを反映します。 +1 for on (the program was run with B<-T>), 0 for off, -1 when only taint warnings are enabled (i.e. with B<-t> or B<-TU>). This variable is read-only. (TBT) @@ -3003,7 +3007,7 @@ この変数は perl 5.6.0 で最初に現れました; それより前のバージョンでは 未定義値となります。 -perl 5.10.0 以前では $^V v-string 形式で表現されます。 +perl 5.10.0 以前では $^V は v-string 形式で表現されます。 =begin original @@ -3026,9 +3030,7 @@ =end original -To convert C<$^V> into its string representation use sprintf()'s -C<"%vd"> conversion: -(TBT) +C<$^V> を文字列表現に変換するには sprintf() の C<"%vd"> 変換を使います: printf "version is v%vd\n", $^V; # Perl's version @@ -3127,9 +3129,8 @@ =end original -Perl バイナリ自身が実行された時の名前を C の argv[0] -or (where supported) F</proc/self/exe> -から持ってきたものです。 +Perl バイナリ自身が実行された時の名前を C の argv[0] または (対応していれば) +F</proc/self/exe> から持ってきたものです。 =begin original