1PICONV(1) User Contributed Perl Documentation PICONV(1)
2
3
4
6 piconv -- iconv(1), reinvented in perl
7
9 piconv [-f from_encoding] [-t to_encoding]
10 [-p|--perlqq|--htmlcref|--xmlcref] [-C N|-c] [-D] [-S scheme]
11 [-s string|file...]
12 piconv -l
13 piconv -r encoding_alias
14 piconv -h
15
17 piconv is perl version of iconv, a character encoding converter widely
18 available for various Unixen today. This script was primarily a
19 technology demonstrator for Perl 5.8.0, but you can use piconv in the
20 place of iconv for virtually any case.
21
22 piconv converts the character encoding of either STDIN or files
23 specified in the argument and prints out to STDOUT.
24
25 Here is the list of options. Some options can be in short format (-f)
26 or long (--from) one.
27
28 -f,--from from_encoding
29 Specifies the encoding you are converting from. Unlike iconv, this
30 option can be omitted. In such cases, the current locale is used.
31
32 -t,--to to_encoding
33 Specifies the encoding you are converting to. Unlike iconv, this
34 option can be omitted. In such cases, the current locale is used.
35
36 Therefore, when both -f and -t are omitted, piconv just acts like
37 cat.
38
39 -s,--string string
40 uses string instead of file for the source of text.
41
42 -l,--list
43 Lists all available encodings, one per line, in case-insensitive
44 order. Note that only the canonical names are listed; many aliases
45 exist. For example, the names are case-insensitive, and many
46 standard and common aliases work, such as "latin1" for
47 "ISO-8859-1", or "ibm850" instead of "cp850", or "winlatin1" for
48 "cp1252". See Encode::Supported for a full discussion.
49
50 -r,--resolve encoding_alias
51 Resolve encoding_alias to Encode canonical encoding name.
52
53 -C,--check N
54 Check the validity of the stream if N = 1. When N = -1, something
55 interesting happens when it encounters an invalid character.
56
57 -c Same as "-C 1".
58
59 -p,--perlqq
60 Transliterate characters missing in encoding to \x{HHHH} where HHHH
61 is the hexadecimal Unicode code point.
62
63 --htmlcref
64 Transliterate characters missing in encoding to &#NNN; where NNN is
65 the decimal Unicode code point.
66
67 --xmlcref
68 Transliterate characters missing in encoding to &#xHHHH; where HHHH
69 is the hexadecimal Unicode code point.
70
71 -h,--help
72 Show usage.
73
74 -D,--debug
75 Invokes debugging mode. Primarily for Encode hackers.
76
77 -S,--scheme scheme
78 Selects which scheme is to be used for conversion. Available
79 schemes are as follows:
80
81 from_to
82 Uses Encode::from_to for conversion. This is the default.
83
84 decode_encode
85 Input strings are decode()d then encode()d. A straight two-
86 step implementation.
87
88 perlio
89 The new perlIO layer is used. NI-S' favorite.
90
91 You should use this option if you are using UTF-16 and others
92 which linefeed is not $/.
93
94 Like the -D option, this is also for Encode hackers.
95
97 iconv(1) locale(3) Encode Encode::Supported Encode::Alias PerlIO
98
99
100
101perl v5.28.1 2019-03-13 PICONV(1)