Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ iconv(1) — DG/UX R4.11MU05

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

kbdcomp(1M)

kbdset(1)

kbdload(1M)

kbdpipe(1)

conv(3C)



iconv(1)                       DG/UX R4.11MU05                      iconv(1)


NAME
       iconv - code set conversion

SYNOPSIS
       iconv -f fromcode -t tocode [-m mode] [file(s)]

DESCRIPTION
       Iconv converts the encoding of characters in file(s) from one code
       set to another and writes the results to standard output.

       The required arguments fromcode and tocode identify the input and
       output code sets, respectively.  The optional argument mode provides
       a further distinction between multiple code set maps for the same
       fromcode and tocode.  If no file(s) arguments are specified on the
       command line, iconv reads the standard input.

       Iconv uses the database file /usr/lib/kbd/iconvdata.  This file has
       4 required fields fromcode, tocode, table, file and one optional
       field mode.  The order of the database fields is as named above.  The
       database fields are separated by spaces or tabs, and the database
       rows are separated by newlines.

       Iconv matches the required arguments fromcode and tocode and the
       optional argument mode to the corresponding fields in the database.

       The field mode does not have to be uniformly included or excluded
       from the database, i.e. it may be included in some rows and not in
       others.  If the argument mode is not included in the iconv command
       line, iconv will match the first row found that contains the correct
       fromcode and tocode fields, ignoring any mode fields.

       The naming conventions in the database are left entirely up to the
       user.  However, absolute pathnames are required for the file fields
       not located in /usr/lib/kbd, as kbdpipe assumes that any file in the
       "-f file" argument that does not begin with "/" will be found in
       /usr/lib/kbd.

       The codeset conversions supported in the supplied database are given
       in the table below.
                  +---------------------------------------------+
                  |       Code Set Conversions Supported        |
                  |fromcode   tocode    modes       comment     |
                  +---------------------------------------------+
                  |ASCII      88591    d b e p                  |
                  |88591      ASCII    d b e p                  |
                  |6937       88591              Teletext       |
                  |88591      6937               Teletext       |
                  |646        88591    d         US Ascii       |
                  |646DE      88591    d         German         |
                  |646DK      88591    d         Danish         |
                  |646GB      88591    d         English Ascii  |
                  |646ES      88591    d         Spanish        |
                  |646FR      88591    d         French         |
                  |646IT      88591    d         Italian        |
                  |646NO      88591    d         Norwegian      |
                  |646SE      88591    d         Swedish        |
                  |646PT      88591    d         Portuguese     |
                  |646YU      88592    d         Serbo Croatian |
                  |88591      646      d b e p   7 bit Ascii    |
                  |88592      646      d b e                    |
                  |88591      646DE    d b e p   German         |
                  |88591      646DK    d b e p   Danish         |
                  |88591      646GB    d b e p   English Ascii  |
                  |88591      646ES    d b e p   Spanish        |
                  |88591      646FR    d b e p   French         |
                  |88591      646IT    d b e p   Italian        |
                  |88591      646NO    d b e p   Norwegian      |
                  |88591      646SE    d b e p   Swedish        |
                  |88591      646PT    d b e     Portuguese     |
                  |88592      646YU    d         Serbo Croatian |
                  |PC437      88591    d b e p                  |
                  |88591      PC437    d b e p                  |
                  |PC850      88591    d b e                    |
                  |88591      PC850    d b e p                  |
                  |PC860      88591    d b e                    |
                  |88591      PC860    d b e                    |
                  |PC863      88591    d b e                    |
                  |88591      PC863    d b e                    |
                  |PC865      88591    d b e                    |
                  |88591      PC865    d b e                    |
                +-+---------------------------------------------+-+
                |         Code Set Conversions Supported          |
                |fromcode     tocode      modes       comment     |
                +-------------------------------------------------+
                |PC437      ASCII        d b e                    |
                |PC850      ASCII        d b e                    |
                |PC860      ASCII        d b e                    |
                |PC863      ASCII        d b e                    |
                |PC865      ASCII        d b e                    |
                |ASCII      88591        d b e                    |
                |ASCII      EBCDIC       d                        |
                |EBCDIC     ASCII        d                        |
                |ASCII      IBM_EBCDIC   d                        |
                |PC437      EBCDIC       d                        |
                |EBCDIC     PC437        d                        |
                |PC437      IBM_EBCDIC   d                        |
                |88591      ROMAN8       d         HP LaserJet II |
                |88591      VT220        d b e                    |
                |VT220      88591        d b e                    |
                |88592      646          d b e                    |
                |88593      646          d b e                    |
                |88594      646          d b e                    |
                |88595      646          d b e                    |
                |88597      646          d b e                    |
                |dgi        88591        d b e p                  |
                |88591      dgi          d b e p                  |
                +-------------------------------------------------+
       The fromcodes and tocodes 88591, 646 and 6937 correspond to the
       International Standards ISO 8859-1, ISO 646 and ISO 6937
       respectively.

       The optional modes, d, b, e and p, have the following meaning:

       d        default
                 Any character that cannot be represented is mapped to the
                 "Ultimate fall back character" which in the tables supplied
                 is the underscore character '_'.

       b        best fit with no expansion
                 Characters are where possible, mapped to the closest
                 approximation of that character but always without
                 expansion, i.e., all the character mappings are one-to-one.
                 This will be important, for example, when using curses-
                 based applications where any expansion of a character
                 representation would affect the screen
                 management.          [If such code set mapping are
                 performed by the STREAMS-module in the TTY sub-system then
                 such mappings will be transparent, and the application will
                 have no knowledge that these mappings take place.]
       e        best fit with expansion
                 Characters of the source code set are, where possible,
                 mapped to the closest approximation of that character in
                 the target code set.  Where necessary, the character in the
                 source code set is expanded to a sequence of characters in
                 the target code set.
       p        Printer mode - with overstriking.
                 If there is a non-destructive backspace, as exists on many
                 printers, then some characters that are not available can
                 be displayed by overstriking.  In this way many accented
                 characters can be displayed.

EXAMPLES
       An example of a database for iconv is below, with the following
       fields:

       fromcode   tocode   table          file              mode
       (the above field names are not included in the database).
       ----------------------------------------------------------
       88591      6937     88591.6937.b   pubfile           b
       88591      6937     pubtable       88591.6937.d.t    d
       646        646DE    togerman       /mydir/togerman

       Using the above database, the following converts the contents of
       files mail1 and mail2 from code set 88591 to 6937 using b mode and
       stores the results in file mail.local.

               iconv -f 88591 -t 6937 -m b mail1 mail2 > mail.local

       The following will accomplish the same result as above, as the b mode
       from code set 88591 to 6937 will be the first row found containing
       the correct match.

               iconv -f 88591 -t 6937 mail1 mail2 > mail.local

FILES
       /usr/lib/kbd/iconvdata         default database

EXIT CODES
       The exit status will be set with 0 upon successful completion, 1
       otherwise.

SEE ALSO
       kbdcomp(1M), kbdset(1), kbdload(1M), kbdpipe(1), conv(3C),
       attkbd(7).


Licensed material--property of copyright holder(s)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026