Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) How to submit bug reports on PerlRun tests through a TAP harness. (Berikutnya)
Utilities

Iconv(1), reinvented in perl

Daftar Isi

NAME

piconv -- iconv(1), reinvented in perl

SYNOPSIS

  1. piconv [-f from_encoding] [-t to_encoding] [-s string] [files...]
  2. piconv -l
  3. piconv [-C N|-c|-p]
  4. piconv -S scheme ...
  5. piconv -r encoding
  6. piconv -D ...
  7. piconv -h

DESCRIPTION

piconv is perl version of iconv, a character encoding converterwidely available for various Unixen today. This script was primarilya technology demonstrator for Perl 5.8.0, but you can use piconv in theplace of iconv for virtually any case.

piconv converts the character encoding of either STDIN or filesspecified in the argument and prints out to STDOUT.

Here is the list of options. Each option can be in short format (-f)or long (--from).

  • -f,--from from_encoding

    Specifies the encoding you are converting from. Unlike iconv,this option can be omitted. In such cases, the current locale is used.

  • -t,--to to_encoding

    Specifies the encoding you are converting to. Unlike iconv,this option can be omitted. In such cases, the current locale is used.

    Therefore, when both -f and -t are omitted, piconv just actslike cat.

  • -s,--string string

    uses string instead of file for the source of text.

  • -l,--list

    Lists all available encodings, one per line, in case-insensitiveorder. Note that only the canonical names are listed; many aliasesexist. For example, the names are case-insensitive, and many standardand common aliases work, such as "latin1" for "ISO-8859-1", or "ibm850"instead of "cp850", or "winlatin1" for "cp1252". See Encode::Supportedfor a full discussion.

  • -C,--check N

    Check the validity of the stream if N = 1. When N = -1, somethinginteresting happens when it encounters an invalid character.

  • -c

    Same as -C 1.

  • -p,--perlqq
  • --htmlcref
  • --xmlcref

    Applies PERLQQ, HTMLCREF, XMLCREF, respectively. Try

    1. piconv -f utf8 -t ascii --perlqq

    To see what it does.

  • -h,--help

    Show usage.

  • -D,--debug

    Invokes debugging mode. Primarily for Encode hackers.

  • -S,--scheme scheme

    Selects which scheme is to be used for conversion. Available schemesare as follows:

    • from_to

      Uses Encode::from_to for conversion. This is the default.

    • decode_encode

      Input strings are decode()d then encode()d. A straight two-stepimplementation.

    • perlio

      The new perlIO layer is used. NI-S' favorite.

      You should use this option if you are using UTF-16 and others whichlinefeed is not $/.

    Like the -D option, this is also for Encode hackers.

SEE ALSO

iconv(1)locale(3)EncodeEncode::SupportedEncode::AliasPerlIO

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) How to submit bug reports on PerlRun tests through a TAP harness. (Berikutnya)