| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "PICONV 1" |
| 58 |
.TH PICONV 1 2026-04-10 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
piconv \-\- iconv(1), reinvented in perl |
| 65 |
.SH SYNOPSIS |
| 66 |
.IX Header "SYNOPSIS" |
| 67 |
.Vb 6 |
| 68 |
\& piconv [\-f from_encoding] [\-t to_encoding] |
| 69 |
\& [\-p|\-\-perlqq|\-\-htmlcref|\-\-xmlcref] [\-C N|\-c] [\-D] [\-S scheme] |
| 70 |
\& [\-s string|file...] |
| 71 |
\& piconv \-l |
| 72 |
\& piconv \-r encoding_alias |
| 73 |
\& piconv \-h |
| 74 |
.Ve |
| 75 |
.SH DESCRIPTION |
| 76 |
.IX Header "DESCRIPTION" |
| 77 |
\&\fBpiconv\fR is perl version of \fBiconv\fR, a character encoding converter |
| 78 |
widely available for various Unixen today. This script was primarily |
| 79 |
a technology demonstrator for Perl 5.8.0, but you can use piconv in the |
| 80 |
place of iconv for virtually any case. |
| 81 |
.PP |
| 82 |
piconv converts the character encoding of either STDIN or files |
| 83 |
specified in the argument and prints out to STDOUT. |
| 84 |
.PP |
| 85 |
Here is the list of options. Some options can be in short format (\-f) |
| 86 |
or long (\-\-from) one. |
| 87 |
.IP "\-f,\-\-from \fIfrom_encoding\fR" 4 |
| 88 |
.IX Item "-f,--from from_encoding" |
| 89 |
Specifies the encoding you are converting from. Unlike \fBiconv\fR, |
| 90 |
this option can be omitted. In such cases, the current locale is used. |
| 91 |
.IP "\-t,\-\-to \fIto_encoding\fR" 4 |
| 92 |
.IX Item "-t,--to to_encoding" |
| 93 |
Specifies the encoding you are converting to. Unlike \fBiconv\fR, |
| 94 |
this option can be omitted. In such cases, the current locale is used. |
| 95 |
.Sp |
| 96 |
Therefore, when both \-f and \-t are omitted, \fBpiconv\fR just acts |
| 97 |
like \fBcat\fR. |
| 98 |
.IP "\-s,\-\-string \fIstring\fR" 4 |
| 99 |
.IX Item "-s,--string string" |
| 100 |
uses \fIstring\fR instead of file for the source of text. |
| 101 |
.IP \-l,\-\-list 4 |
| 102 |
.IX Item "-l,--list" |
| 103 |
Lists all available encodings, one per line, in case-insensitive |
| 104 |
order. Note that only the canonical names are listed; many aliases |
| 105 |
exist. For example, the names are case-insensitive, and many standard |
| 106 |
and common aliases work, such as "latin1" for "ISO\-8859\-1", or "ibm850" |
| 107 |
instead of "cp850", or "winlatin1" for "cp1252". See Encode::Supported |
| 108 |
for a full discussion. |
| 109 |
.IP "\-r,\-\-resolve \fIencoding_alias\fR" 4 |
| 110 |
.IX Item "-r,--resolve encoding_alias" |
| 111 |
Resolve \fIencoding_alias\fR to Encode canonical encoding name. |
| 112 |
.IP "\-C,\-\-check \fIN\fR" 4 |
| 113 |
.IX Item "-C,--check N" |
| 114 |
Check the validity of the stream if \fIN\fR = 1. When \fIN\fR = \-1, something |
| 115 |
interesting happens when it encounters an invalid character. |
| 116 |
.IP \-c 4 |
| 117 |
.IX Item "-c" |
| 118 |
Same as \f(CW\*(C`\-C 1\*(C'\fR. |
| 119 |
.IP \-p,\-\-perlqq 4 |
| 120 |
.IX Item "-p,--perlqq" |
| 121 |
Transliterate characters missing in encoding to \ex{HHHH} where HHHH is the |
| 122 |
hexadecimal Unicode code point. |
| 123 |
.IP \-\-htmlcref 4 |
| 124 |
.IX Item "--htmlcref" |
| 125 |
Transliterate characters missing in encoding to &#NNN; where NNN is the |
| 126 |
decimal Unicode code point. |
| 127 |
.IP \-\-xmlcref 4 |
| 128 |
.IX Item "--xmlcref" |
| 129 |
Transliterate characters missing in encoding to &#xHHHH; where HHHH is the |
| 130 |
hexadecimal Unicode code point. |
| 131 |
.IP \-h,\-\-help 4 |
| 132 |
.IX Item "-h,--help" |
| 133 |
Show usage. |
| 134 |
.IP \-D,\-\-debug 4 |
| 135 |
.IX Item "-D,--debug" |
| 136 |
Invokes debugging mode. Primarily for Encode hackers. |
| 137 |
.IP "\-S,\-\-scheme \fIscheme\fR" 4 |
| 138 |
.IX Item "-S,--scheme scheme" |
| 139 |
Selects which scheme is to be used for conversion. Available schemes |
| 140 |
are as follows: |
| 141 |
.RS 4 |
| 142 |
.IP from_to 4 |
| 143 |
.IX Item "from_to" |
| 144 |
Uses Encode::from_to for conversion. This is the default. |
| 145 |
.IP decode_encode 4 |
| 146 |
.IX Item "decode_encode" |
| 147 |
Input strings are \fBdecode()\fRd then \fBencode()\fRd. A straight two-step |
| 148 |
implementation. |
| 149 |
.IP perlio 4 |
| 150 |
.IX Item "perlio" |
| 151 |
The new perlIO layer is used. NI\-S' favorite. |
| 152 |
.Sp |
| 153 |
You should use this option if you are using UTF\-16 and others which |
| 154 |
linefeed is not $/. |
| 155 |
.RE |
| 156 |
.RS 4 |
| 157 |
.Sp |
| 158 |
Like the \fI\-D\fR option, this is also for Encode hackers. |
| 159 |
.RE |
| 160 |
.SH "SEE ALSO" |
| 161 |
.IX Header "SEE ALSO" |
| 162 |
\&\fBiconv\fR\|(1) |
| 163 |
\&\fBlocale\fR\|(3) |
| 164 |
Encode |
| 165 |
Encode::Supported |
| 166 |
Encode::Alias |
| 167 |
PerlIO |