X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlebcdic.pod;h=12ea2f3ef4b1634e54918ee732f4bbd55fa5945e;hb=de4864e4e7ced178416488fa2591227064c3222d;hp=4ef5eca2d03cb1cdb945c3686714bb2e281124b9;hpb=1e054b24367d88522dd8c16e0f610b402e868c38;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlebcdic.pod b/pod/perlebcdic.pod index 4ef5eca..12ea2f3 100644 --- a/pod/perlebcdic.pod +++ b/pod/perlebcdic.pod @@ -501,7 +501,8 @@ provide easy to use ASCII to EBCDIC operations that are also easily reversed. For example, to convert ASCII to code page 037 take the output of the second -column from the output of recipe 0 and use it in tr/// like so: +column from the output of recipe 0 (modified to add \\ characters) and use +it in tr/// like so: $cp_037 = '\000\001\002\003\234\011\206\177\227\215\216\013\014\015\016\017' . @@ -524,15 +525,19 @@ column from the output of recipe 0 and use it in tr/// like so: my $ebcdic_string = $ascii_string; eval '$ebcdic_string =~ tr/\000-\377/' . $cp_037 . '/'; -To convert from EBCDIC to ASCII just reverse the order of the tr/// +To convert from EBCDIC 037 to ASCII just reverse the order of the tr/// arguments like so: my $ascii_string = $ebcdic_string; - eval '$ascii_string = tr/' . $code_page_chrs . '/\000-\037/'; + eval '$ascii_string = tr/' . $cp_037 . '/\000-\377/'; + +Similarly one could take the output of the third column from recipe 0 to +obtain a C<$cp_1047> table. The fourth column of the output from recipe +0 could provide a C<$cp_posix_bc> table suitable for transcoding as well. =head2 iconv -XPG4 operability often implies the presence of an I utility +XPG operability often implies the presence of an I utility available from the shell or from the C library. Consult your system's documentation for information on iconv.