home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / chord3_6.zip / chord / recode.txt < prev    next >
Text File  |  2000-04-18  |  70KB  |  1,680 lines

  1. recode     Conversion between character sets and usages.
  2.  
  3.    This file documents the `recode' command, which has the purpose of
  4. converting files between various character sets and usages.
  5.  
  6.    Copyright (C) 1990, 1993, 1994 Free Software Foundation, Inc.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that
  14. the entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.  
  17.    Permission is granted to copy and distribute translations of this
  18. manual into another language, under the above conditions for modified
  19. versions, except that this permission notice may be stated in a
  20. translation approved by the Foundation.
  21.  
  22.  
  23. GNU `recode'
  24. ************
  25.  
  26.    `recode' converts files between character sets and usages.  When
  27. exact transliterations are not possible, it may get rid of the offending
  28. characters or fall back on approximations.  This program recognizes or
  29. produces nearly 150 different character sets and is able to
  30. transliterate files between almost any pair.  Most RFC 1345 character
  31. sets are supported.
  32.  
  33.    The current `recode' release is 3.4.
  34.  
  35.  
  36. What is the purpose of this program
  37. ***********************************
  38.  
  39.    This `recode' program has the purpose of converting files between
  40. various character sets and usages.  When exact transliterations are not
  41. possible, as it is often the case, the program may get rid of the
  42. offending characters or fall back on approximations.
  43.  
  44.    Let us coin the term "charset" to represent, without distinction, a
  45. character set "per se" or a particular usage of a character set.  This
  46. program recognizes or produces around 150 such charsets.  Since it can
  47. convert each charset to almost any other one, many thousands of
  48. different conversions are possible.
  49.  
  50.    This tool pays special attention to superimposition of diacritics for
  51. French representation.  This orientation is mostly historical, it does
  52. not impair the usefulness, generality or extensibility of the program.
  53.  
  54.  
  55. Overview of charsets
  56. ====================
  57.  
  58.    Recoding is currently possible between most of the charsets
  59. described in RFC 1345.
  60.  
  61.    Recode also handles some charsets in more specialized ways.  These
  62. are:
  63.  
  64.    * usual 7-bit ASCII: without any diacritics, or else: using
  65.      backspace for overstriking; Unisys' ICON convention; TeX/LaTeX
  66.      coding; easy French conventions for electronic mail;
  67.  
  68.    * 8-bit extensions to ASCII: ISO Latin-1, Atari ST code, IBM's code
  69.      for the PC, Apple's code for the Macintosh, NeXT code;
  70.  
  71.    * 6-bit escaped ASCII based on CDC display code: 6/12 code from NOS;
  72.      bang-bang code from Universit'e de Montr'eal;
  73.  
  74.    * non-ASCII codes: three flavors of EBCDIC.
  75.  
  76.    The recent introduction of RFC 1345 in GNU `recode' has brought with
  77. it a few charsets having the functionality of older ones, but yet being
  78. different in subtle ways.  The effects have not been fully investigated
  79. yet, so for now, clashes are avoided, the old and new charsets are kept
  80. well separate.  For example, wizards would be interested in comparing
  81. the output of these two commands:
  82.  
  83.      recode -vh IBM-PC:Apple-Mac
  84.      recode -vh IBM437:macintosh
  85.  
  86. The first command uses only charsets prior to RFC 1345 introduction.
  87. Both methods give different recodings, the first also properly recodes
  88. end of lines.  These differences are annoying, the fuzziness will have
  89. to be explained and settle down one day.
  90.  
  91.  
  92. Contributions and bug reports
  93. =============================
  94.  
  95.    Even being the `recode' author and current maintainer, I am no
  96. specialist in charset standards.  I only made `recode' along the years
  97. to solve my own needs, but felt it was applicable for the needs of
  98. others.  Some GNU people liked the program structure and suggested to
  99. make it more widely available.  I rely on GNU users judgment for what
  100. is best to be done next.
  101.  
  102.    Properly protecting GNU `recode' about possible copyright fights is
  103. a pain for me and for contributors, but we cannot avoid addressing the
  104. issue in the long run.  Besides, the Free Software Foundation, which
  105. mandates the GNU project, is very sensible to this matter.  GNU
  106. standards require that I be cautious before looking at copyrighted code.
  107. The safest and simplest way for me is to gather ideas and reprogram them
  108. anew, even if this might slow me down considerably.  For contributions
  109. going beyond a few lines of code here and there, the FSF definitely
  110. requires employer disclaimers and copyright assignments in writing.
  111.  
  112.    Many users contributed to GNU `recode' already, I am grateful to
  113. them for their interest and involvement.  Some suggestions can be
  114. integrated quickly while some others have to be delayed, I have to draw
  115. a line somewhere when time comes to make a new release, about what would
  116. go in it and what would go in the next.  Also, when you contribute
  117. something to `recode', *please* explain what it is about.  Do not take
  118. for granted that I know those charsets which are familiar to you.  Your
  119. explanations could well find their way into this documentation, too.
  120.  
  121.    Mail suggestions, documentation errors and bug reports to
  122. `bug-gnu-utils@prep.ai.mit.edu' or, if you prefer, directly to Francois
  123. Pinard `pinard@iro.umontreal.ca'.  Do not be afraid to report details,
  124. because this program is the mere aggregation of hundreds of details.
  125.  
  126.  
  127. How to use this program
  128. ***********************
  129.  
  130.    The general format of the program call is one of:
  131.  
  132.      recode [OPTION]... [CHARSET]
  133.      recode [OPTION]... [BEFORE]:[AFTER] [FILE]...
  134.  
  135.    The second form is the common case.  Each FILE will be read assuming
  136. it is coded with charset BEFORE, it will be recoded over itself so to
  137. use the charset AFTER.  If there is no such FILE, the program rather
  138. acts as a filter and recode standard input to standard output.
  139.  
  140.    The available options are:
  141.  
  142. `-C'
  143. `--copyright'
  144.      Given this option, all other parameters and options are ignored.
  145.      The program prints briefly the Copyright and copying conditions.
  146.      See the file `COPYING' in the distribution for full statement of
  147.      the Copyright and copying conditions.
  148.  
  149. `-a'
  150. `--auto-check'
  151.      In this special mode, `recode' diagnostics itself by analyzing
  152.      connectivity of the various charsets and reporting on standard
  153.      output.  No file will be recoded.
  154.  
  155.      There might be one non-option argument, in which case it is
  156.      interpreted as a charset name, possibly abbreviated to any non
  157.      ambiguous prefix.  `recode' will then study all recodings having
  158.      the given charset as a starting or ending point.  If there is no
  159.      such non-option argument, `recode' will study *all* possible
  160.      recodings.
  161.  
  162.      For each possible pair of different charsets, it prints on standard
  163.      output how many single steps are needed for achieving the recoding
  164.      and how many can be saved by step merging.  If a recoding cannot
  165.      be done, the word `UNACHIEVABLE' is printed instead.  However,
  166.      this special line is completely suppressed if option `-x'
  167.      specified some charset to ignore.
  168.  
  169.      The option `-hNAME' affects the resulting output, because there
  170.      are more merging rules when this option is in effect.  Other
  171.      options affect the result: `-d', `-g' and, notably, `-s'.
  172.  
  173.      There was a time, in GNU `recode' development, when this option was
  174.      reasonably interesting.  With the greater number of handled
  175.      charsets, it became inordinately slow, taking on the order of one
  176.      hour of wall clock time, while generating a great deal of output.
  177.      This option is not practical anymore when used without a charset
  178.      parameter.  However, it can be made slightly more usable, together
  179.      with option `-x.', which effectively disables most RFC 1345
  180.      charsets from the report.
  181.  
  182. `-c'
  183. `--colons'
  184.      With `Texte' Easy French conventions, use the column `:' instead
  185.      of the double-quote `"' for marking diaeresis.
  186.  
  187. `-d'
  188. `--diacritics'
  189.      While converting to or from one of `HTML' or `LaTeX' charset,
  190.      limit conversion to diacritics only.  This is particularly useful
  191.      when people write what would be valid `HTML', TeX or LaTeX files,
  192.      if only they were using provided sequences for applying diacritics
  193.      instead of using the diacriticized characters directly from the
  194.      underlying character set.
  195.  
  196.      While converting to `HTML' or `LaTeX' charset, this option assumes
  197.      that non-diacriticized special characters are properly coded or
  198.      protected, so `recode' will transmit them literally.  While
  199.      converting the other way, this option prevents all attempts at
  200.      recognizing coded or protected versions of non-diacriticized
  201.      special characters of the other charset.
  202.  
  203. `-f'
  204. `--force'
  205.      It is planned that some future version of `recode' will protect
  206.      you against recoding a file irreversibly over itself.  However,
  207.      please keep vividly in mind that this protection is not yet active
  208.      in `recode'.  When the protection will be enforced, option `-f'
  209.      will become mandatory for a file to be replaced by some recoding
  210.      of its contents, if such conversion is loosing information.  For
  211.      now, `recode' acts as if option `-f' was always selected.
  212.  
  213.      In preparation for the time this option will become mandatory, you
  214.      may start using `-f' right away in scripts calling `recode', when
  215.      you know this is the reasonnable thing to do.
  216.  
  217. `-g'
  218. `--graphics'
  219.      This option is only meaningful while getting *out* of the `IBM-PC'
  220.      charset.  In this charset, characters 176 to 223 are used for
  221.      constructing rulers and boxes, using simple or double horizontal or
  222.      vertical lines.  This option forces the automatic selection of
  223.      ASCII characters for approximating these rulers and boxes, at cost
  224.      of making the transformation irreversible.  Option `-g' implies
  225.      `-f'.
  226.  
  227. `-h[NAME]'
  228. `--header[=NAME]'
  229.      Instead of recoding files, `recode' writes a C source file on
  230.      standard output and exits.  This source is meant to be included in
  231.      a regular C program: its purpose is to declare and initialize an
  232.      array, named NAME, which represents the requested recoding.  If
  233.      NAME is not specified, then it defaults to `BEFORE_to_AFTER',
  234.      where BEFORE is the starting charset and AFTER is the goal charset.
  235.  
  236.      Even if `recode' tries its best, this option does not always
  237.      succeed in producing the requested C table.  It will however,
  238.      provided the recoding can be internally represented by only one
  239.      step after the optimization phase, and if this merged step conveys
  240.      a one-to-one or a one-to-many explicit table.  But this is all
  241.      fairly technical.  Better try and see!
  242.  
  243.      Beware that other options might affect the produced C tables,
  244.      these are: `-d', `-g' and, particularly, `-s'.
  245.  
  246. `-i'
  247. `--sequence=files'
  248.      When the recoding requires a combination of two or more elementary
  249.      recoding steps, this option forces many passes over the data, using
  250.      intermediate files between passes.  This is the default behavior
  251.      when files are recoded over themselves.  If this option is
  252.      selected in filter mode, that is, when the program reads standard
  253.      input and writes standard output, it might take longer for
  254.      programs further down the pipe chain to start receiving some
  255.      recoded data.
  256.  
  257. `-l[FORMAT]'
  258. `--list[=FORMAT]'
  259.      This option asks for information about all charsets, or about one
  260.      particular charset.  No file will be recoded.
  261.  
  262.      If there is no non-option arguments, `recode' ignores the FORMAT
  263.      value of the option, it writes a sorted list of charset names on
  264.      standard output, one per line.  When a charset name have aliases
  265.      or synonyms, they follow the true charset name on its line,
  266.      presented in lexicographical order from left to right.  This list
  267.      is over one hundred lines.  It is best used with `grep', as in:
  268.  
  269.           recode -l | grep greek
  270.  
  271.      There might be one non-option argument, in which case it is
  272.      interpreted as a charset name, possibly abbreviated to any non
  273.      ambiguous prefix.  This particular usage of the `-l' option is
  274.      obeyed *only* for charsets having an RFC 1345 style internal
  275.      description.  Even if most charsets have this property, some do
  276.      not, then option `-l' cannot be used to detail these particular
  277.      charsets.  For knowing if a particular charset can be listed this
  278.      way, you should merely try and see if this works.  The FORMAT
  279.      value of the option is a keyword from the following list.
  280.      Keywords may be abbreviated by dropping suffix letters, and even
  281.      reduced to the first letter only:
  282.  
  283.     `decimal'
  284.           This format asks for the production on standard output of a
  285.           concise tabular display of the charset, in which character
  286.           code values are expressed in decimal.
  287.  
  288.     `octal'
  289.           This format uses octal instead of decimal in the concise
  290.           tabular display of the charset.
  291.  
  292.     `hexadecimal'
  293.           This format uses hexadecimal instead of decimal in the
  294.           concise tabular display of the charset.
  295.  
  296.     `full'
  297.           This format requests an extensive display of the charset on
  298.           standard output, using one line per character showing its
  299.           decimal, hexadecimal and octal code values, and also a
  300.           descriptive comment which is indeed the 10646 character name.
  301.  
  302.      When option `-l' is used together with a CHARSET argument, the
  303.      FORMAT defaults to `decimal'.
  304.  
  305. `-o'
  306. `--sequence=popen'
  307.      When the recoding requires a combination of two or more elementary
  308.      recoding steps, this option forces the creation of a chain of
  309.      program instances initiated through the `popen(3)' library call,
  310.      all operating in parallel.  In filter mode, costing the overhead
  311.      of multiple program initializations, recoded data will be
  312.      available soon after the program starts, even if many elementary
  313.      recoding steps are required.
  314.  
  315.      If, at installation time, the `popen(3)' call is said to be
  316.      unavailable, selecting option `-o' is equivalent to selecting
  317.      option `-i'.
  318.  
  319. `-p'
  320. `--sequence=pipe'
  321.      When the recoding requires a combination of two or more elementary
  322.      recoding steps, this option forces the program to fork itself into
  323.      a few copies interconnected with pipes, using the `pipe(2)' system
  324.      call.  All copies of the program operate in parallel.  This method
  325.      is similar to the method used through option `-o', but is more
  326.      efficient because the program initializes only once.  This is the
  327.      default behavior in filter mode.  If this option is used when
  328.      files are recoded over themselves, this should also save disk
  329.      space because some temporary files might not be needed, at cost of
  330.      more system overhead.
  331.  
  332.      If, at installation time, the `pipe(2)' call is said to be
  333.      unavailable, selecting option `-p' is equivalent to selecting
  334.      option `-o'.  If both `pipe(2)' and `popen(3)' are unavailable,
  335.      selecting option `-p' is equivalent to selecting option `-i'.
  336.  
  337. `-q'
  338. `--quiet'
  339. `--silent'
  340.      This option has the sole purpose of inhibiting diagnostic messages
  341.      about irreversible recodings.
  342.  
  343.      This option is set automatically for the children processes, when
  344.      recode splits itself in many collaborating copies.  Doing so, the
  345.      diagnostic is issued only once by the parent.  See options `-o'
  346.      and `-p'.
  347.  
  348. `-s'
  349. `--strict'
  350.      By using this option, the user requests that `recode' be very
  351.      strict while recoding a file, merely loosing in the transformation
  352.      any character which is not explicitly mapped from a charset to
  353.      another.  This option renders the recoding less likely reversible,
  354.      so it also implies option `-f'.
  355.  
  356. `-t'
  357. `--touch'
  358.      The *touch* option is meaningful only when files are recoded over
  359.      themselves.  Without it, the time-stamps associated with files are
  360.      preserved, to reflect the fact that changing the code of a file
  361.      does not really alter its informational contents.  When the user
  362.      wants the recoded files to be time-stamped at the recoding time,
  363.      this option inhibits the automatic protection of the time-stamps.
  364.  
  365. `-v'
  366. `--verbose'
  367.      Before doing any recoding, the program will first print on `stderr'
  368.      the list of all intermediate charsets planned for recoding,
  369.      starting with the BEFORE charset and ending with the AFTER charset.
  370.      It also prints an indication of the recoding quality, as one of
  371.      the word `reversible', `one to one', `one to many', `many to one'
  372.      or `many to many'.
  373.  
  374.      This information will appear once or twice.  It is shown a second
  375.      time only when the optimization and step merging phase succeeds in
  376.      creating a new single step.
  377.  
  378.      This option also has a second effect.  The program will print on
  379.      `stderr' one message per FILE recoded, so to let the user informed
  380.      of the progress of its command.
  381.  
  382.      An easy way to know beforehand the sequence or quality of a
  383.      recoding is by using the command such as:
  384.  
  385.           recode -v BEFORE:AFTER < /dev/null
  386.  
  387.      using the fact that, *so far* in `recode', an empty input file
  388.      produces an empty output file.
  389.  
  390. `-x=CHARSET'
  391. `--ignore=CHARSET'
  392.      This option tells the program to ignore any recoding path through
  393.      the specified CHARSET, so disabling any single step using this
  394.      charset as a start or end point.  This may be used when the user
  395.      wants to force `recode' in using an alternate recoding path.
  396.  
  397.      CHARSET may be abbreviated to any unambiguous prefix.  For
  398.      convenience, the value `.' is an alias for `RFC 1345', so the
  399.      option `-x.' effectively disables *all* RFC 1345 tables at once.
  400.  
  401. `--help'
  402.      The program merely prints a page of help on standard output, and
  403.      exits without doing any recoding.
  404.  
  405. `--version'
  406.      The program merely prints its version numbers on standard output,
  407.      and exits without doing anything else.
  408.  
  409.    The BEFORE:AFTER argument specifies the start charset and the goal
  410. charset.  The allowable values for BEFORE or AFTER are described in the
  411. remainder of this document.  Charsets may have predefined alternate
  412. names, or aliases, which are equally acceptable.
  413.  
  414.    In the BEFORE:AFTER argument only, a backslash may be used to quote
  415. the next character of a charset name.  This might be useful for
  416. preventing a colon to be mistakenly interpreted as the separator between
  417. BEFORE and AFTER.  Rather, the colon could be omitted, because while
  418. recognizing a charset name or alias, GNU `recode' ignores all
  419. characters besides letters and digits.  There is also no distinction
  420. between upper and lower case.  Charset names or aliases may always be
  421. abbreviated to any unambiguous prefix.
  422.  
  423.    One or both of the BEFORE or AFTER keywords may be omitted, but the
  424. colon which separates them cannot.  An omitted keyword implies the
  425. usual or default code in usage on the system where this program is
  426. installed.  Usually, this default code is `Latin-1' for UNIX systems or
  427. `IBM-PC' for MS-DOS machines.
  428.  
  429.  
  430. Reversibility issues
  431. ********************
  432.  
  433.    Even if GNU `recode' tries hard at keeping the recodings reversible,
  434. you should not develop an unconditional confidence in its ability to do
  435. so.  You *ought* to keep only reasonable expectations about reverse
  436. recodings.  In particular, consider:
  437.  
  438.    * Most transformations are fully reversible for all inputs, but
  439.      loose this property whenever `-s' is specified.
  440.  
  441.    * A few transformations are not meant to be reversible, by design.
  442.  
  443.    * Reversibility sometimes depends on actual file contents and cannot
  444.      be ascertained beforehand, without reading the file.
  445.  
  446.    * Reversibility is never absolute across successive versions of this
  447.      program.  Even correcting a small bug in a mapping could induce
  448.      slight discrepancies later.
  449.  
  450.    * Reversibility is easily lost by merging.  This is best explained
  451.      through an example.  If you reversibly recode a file from charset
  452.      `A' to charset `B', then you reversibly recode the result from
  453.      charset `B' to charset `C', you cannot expect to recover the
  454.      original file by merely recoding from charset `C' directly to
  455.      charset `A'.  You will instead have to recode from charset `C'
  456.      back to charset `B', and only then from charset `B' to charset `A'.
  457.  
  458.    * Faulty files create a particular problem.  Consider an example,
  459.      recoding from `IBM-PC' to `Latin-1'.  End of lines are represented
  460.      as `\r\n' in `IBM-PC' and as `\n' in `Latin-1'.  There is no way
  461.      by which a faulty `IBM-PC' file containing a `\n' not preceded by
  462.      `\r' be translated into a `Latin-1' file, and then back.
  463.  
  464.    * There is another difficulty arising from code equivalences.  For
  465.      example, in a `LaTeX' charset file, the string `\^\i{}' could be
  466.      recoded back and forth through another charset and become
  467.      `\^{\i}'.  Even if the resulting file is equivalent to the
  468.      original one, it is not identical.
  469.  
  470.    Unless option `-s' is used, `recode' automatically tries to fill
  471. mappings with invented correspondences, often making them fully
  472. reversible.  This filling is not made at random.  The algorithm tries to
  473. stick to the identity mapping and, when this is not possible, it prefers
  474. generating many small permutation cycles, each involving only a few
  475. codes.
  476.  
  477.    For example, here is how IBM-PC code 186 gets translated to control-U
  478. in Latin-1.  Control-U is 21.  Code 21 is the IBM-PC section sign,
  479. which is 167 in Latin-1.  `recode' cannot reciprocate 167 to 21,
  480. because 167 is the masculine ordinal indicator on IBM PC's, which is
  481. 186 in Latin-1.  Code 186 in IBM PC's has no Latin-1 equivalent; by
  482. assigning back to 21, `recode' closes this short permutation loop.
  483.  
  484.    As a consequence of this map filling, `recode' may sometimes produce
  485. *funny* characters.  They may look annoying, they are nevertheless
  486. helpful when one changes his/her mind and wants to revert to the prior
  487. recoding.  If you cannot stand these, use option `-s', which asks for a
  488. very strict recoding.
  489.  
  490.    This map filling sometimes has another surprising consequence.  In
  491. some cases, `recode' seems to copy a file without recoding it.  But in
  492. fact, it does.  As an illuminating example, consider you requested:
  493.  
  494.      recode l1:us < File-Latin1 > File-ASCII
  495.      cmp File-Latin1 File-ASCII
  496.  
  497. then `cmp' will not report any difference.  This is quite normal.
  498. Latin-1 gets correctly recoded to ASCII for charsets commonalities
  499. (which are the first 128 characters, in this case).  The remaining last
  500. 128 Latin-1 characters have no ASCII correspondent.  Instead of loosing
  501. them, recode elects to map them to unspecified characters of ASCII, so
  502. making the recoding reversible.  The simplest way of achieving this is
  503. merely to keep those last 128 characters unchanged.  The overall effect
  504. is copying the file verbatim.
  505.  
  506.    If you feel this behavior is too generous and if you do not wish to
  507. care about reversibility, simply use option `-s'.  By doing so,
  508. `recode' will strictly map only those Latin-1 characters which have an
  509. ASCII equivalent, and will merely drop those which do not.  Then, there
  510. is more chance that you will observe a difference between the input and
  511. the output file.
  512.  
  513.  
  514. Charsets from RFC 1345
  515. **********************
  516.  
  517.    In the GNU `recode' distribution, there is a copy of RFC 1345:
  518.  
  519.      "Character Mnemonics & Character Sets", K. Simonsen, Request for
  520.      Comments no. 1345, Network Working Group, June 1992.
  521.  
  522.    This document is also available by anonymous ftp at `nic.ddn.mil' in
  523. directory `rfc' as file `rfc1345.txt'.  This report defines many
  524. character mnemonics and character sets.
  525.  
  526.    GNU `recode' implements most of RFC 1345, however:
  527.  
  528.   1. It does not recognize 16-bits charsets: `GB_2312-80',
  529.      `JIS_C6226-1978', `JIS_C6226-1983', `JIS_X0212-1990' and
  530.      `KS_C_5601-1987'.
  531.  
  532.   2. It does not recognize those charsets which combine two characters
  533.      for representing a third: `ANSI_X3.110-1983', `ISO_6937-2-add',
  534.      `T.101-G2', `T.61-8bit', `iso-ir-90' and `videotex-suppl'.
  535.  
  536.   3. It interprets the charset `isoir91' as `NATS-DANO' (alias
  537.      `iso-ir-9-1'), *not* as `JIS_C6229-1984-a' (alias `iso-ir-91').
  538.      So better avoid using these two alias names.
  539.  
  540.   4. It interprets the charset `isoir92' as `NATS-DANO-ADD' (alias
  541.      `iso-ir-9-2'), *not* as `JIS_C6229-1984-b' (alias `iso-ir-92').
  542.      So better avoid using these two alias names.
  543.  
  544.   5. It ignores all about code overloading, but still processes
  545.      correctly the remainder of `dk-us' and `us-dk'.
  546.  
  547.  
  548.    Keld Simonsen `keld@dkuug.dk' did most of RFC 1345 himself, with
  549. some funding from Danish Standards and Nordic standards (INSTA) project.
  550. He also did the character set design work, with substantial input from
  551. Olle Jaernefors.  Keld typed in almost all of the tables, some have been
  552. contributed.  A number of people have checked the tables in various
  553. ways.  The RFC lists a number of people who helped.
  554.  
  555.    Internally, RFC 1345 associates which each character an unambiguous
  556. mnemonic of (usually) one or two characters, taken from ISO 646, a
  557. minimal set of 83 characters.  The charset made up by these mnemonics is
  558. available in `recode' under the name `RFC 1345', with `.' being
  559. accepted as a short alias.
  560.  
  561.    Even if the mnemonics are unambiguous taken separately, strings made
  562. up by concatenating these mnemonics are ambiguous and cannot be safely
  563. interpreted.  So `recode' only allows converting *to* RFC 1345, never
  564. from it.  However, special machinery in the program allows for
  565. converting *through* RFC 1345, when RFC 1345 is neither the initial nor
  566. the final charset of the conversion sequence.
  567.  
  568.    Recoding directly to `.' has the main goal of letting the user
  569. examine foreign charsets.  We cannot do much, mechanically, with the
  570. result.  For increased readability, as a matter of convenience, `SP' is
  571. left as a single space and `LF' becomes a newline.
  572.  
  573. `ANSI_X3.4-1968'
  574.      `ANSI_X3.4-1986', `ASCII', `IBM367', `ISO646-US',
  575.      `ISO_646.irv:1991', `US-ASCII', `cp367', `iso-ir-6' and `us' are
  576.      aliases for this charset.  source: ECMA registry
  577.  
  578. `ASMO_449'
  579.      `ISO_9036', `arabic7' and `iso-ir-89' are aliases for this charset.
  580.      source: ECMA registry
  581.  
  582. `BS_4730'
  583.      `ISO646-GB', `gb', `iso-ir-4' and `uk' are aliases for this
  584.      charset.  source: ECMA registry
  585.  
  586. `BS_viewdata'
  587.      `iso-ir-47' is an alias for this charset.  source: ECMA registry
  588.  
  589. `CSA_Z243.4-1985-1'
  590.      `ISO646-CA', `ca', `csa7-1' and `iso-ir-121' are aliases for this
  591.      charset.  source: ECMA registry
  592.  
  593. `CSA_Z243.4-1985-2'
  594.      `ISO646-CA2', `csa7-2' and `iso-ir-122' are aliases for this
  595.      charset.  source: ECMA registry
  596.  
  597. `CSA_Z243.4-1985-gr'
  598.      `iso-ir-123' is an alias for this charset.  source: ECMA registry
  599.  
  600. `CSN_369103'
  601.      `iso-ir-139' is an alias for this charset.  source: ECMA registry
  602.  
  603. `DEC-MCS'
  604.      `dec' is an alias for this charset.  VAX/VMS User's Manual, Order
  605.      Number: AI-Y517A-TE, April 1986.
  606.  
  607. `DIN_66003'
  608.      `ISO646-DE', `de' and `iso-ir-21' are aliases for this charset.
  609.      source: ECMA registry
  610.  
  611. `DS_2089'
  612.      `DS2089', `ISO646-DK' and `dk' are aliases for this charset.
  613.      source: Danish Standard, DS 2089, February 1974
  614.  
  615. `EBCDIC-AT-DE'
  616.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  617.  
  618. `EBCDIC-AT-DE-A'
  619.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  620.  
  621. `EBCDIC-CA-FR'
  622.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  623.  
  624. `EBCDIC-DK-NO'
  625.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  626.  
  627. `EBCDIC-DK-NO-A'
  628.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  629.  
  630. `EBCDIC-ES'
  631.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  632.  
  633. `EBCDIC-ES-A'
  634.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  635.  
  636. `EBCDIC-ES-S'
  637.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  638.  
  639. `EBCDIC-FI-SE'
  640.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  641.  
  642. `EBCDIC-FI-SE-A'
  643.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  644.  
  645. `EBCDIC-FR'
  646.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  647.  
  648. `EBCDIC-IT'
  649.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  650.  
  651. `EBCDIC-PT'
  652.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  653.  
  654. `EBCDIC-UK'
  655.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  656.  
  657. `EBCDIC-US'
  658.      source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987
  659.  
  660. `ECMA-cyrillic'
  661.      `iso-ir-111' is an alias for this charset.  source: ECMA registry
  662.  
  663. `ES'
  664.      `ISO646-ES' and `iso-ir-17' are aliases for this charset.  source:
  665.      ECMA registry
  666.  
  667. `ES2'
  668.      `ISO646-ES2' and `iso-ir-85' are aliases for this charset.
  669.      source: ECMA registry
  670.  
  671. `GB_1988-80'
  672.      `ISO646-CN', `cn' and `iso-ir-57' are aliases for this charset.
  673.      source: ECMA registry
  674.  
  675. `GOST_19768-74'
  676.      `ST_SEV_358-88' and `iso-ir-153' are aliases for this charset.
  677.      source: ECMA registry
  678.  
  679. `IBM037'
  680.      `cp037', `ebcdic-cp-ca', `ebcdic-cp-nl', `ebcdic-cp-us' and
  681.      `ebcdic-cp-wt' are aliases for this charset.  source: IBM NLS RM
  682.      Vol2 SE09-8002-01, March 1990
  683.  
  684. `IBM038'
  685.      `EBCDIC-INT' and `cp038' are aliases for this charset.  source:
  686.      IBM 3174 Character Set Ref, GA27-3831-02, March 1990
  687.  
  688. `IBM1026'
  689.      `CP1026' is an alias for this charset.  source: IBM NLS RM Vol2
  690.      SE09-8002-01, March 1990
  691.  
  692. `IBM273'
  693.      `CP273' is an alias for this charset.  source: IBM NLS RM Vol2
  694.      SE09-8002-01, March 1990
  695.  
  696. `IBM274'
  697.      `CP274' and `EBCDIC-BE' are aliases for this charset.  source: IBM
  698.      3174 Character Set Ref, GA27-3831-02, March 1990
  699.  
  700. `IBM275'
  701.      `EBCDIC-BR' and `cp275' are aliases for this charset.  source: IBM
  702.      NLS RM Vol2 SE09-8002-01, March 1990
  703.  
  704. `IBM277'
  705.      `EBCDIC-CP-DK' and `EBCDIC-CP-NO' are aliases for this charset.
  706.      source: IBM NLS RM Vol2 SE09-8002-01, March 1990
  707.  
  708. `IBM278'
  709.      `CP278', `ebcdic-cp-fi' and `ebcdic-cp-se' are aliases for this
  710.      charset.  source: IBM NLS RM Vol2 SE09-8002-01, March 1990
  711.  
  712. `IBM280'
  713.      `CP280' and `ebcdic-cp-it' are aliases for this charset.  source:
  714.      IBM NLS RM Vol2 SE09-8002-01, March 1990
  715.  
  716. `IBM281'
  717.      `EBCDIC-JP-E' and `cp281' are aliases for this charset.  source:
  718.      IBM 3174 Character Set Ref, GA27-3831-02, March 1990
  719.  
  720. `IBM284'
  721.      `CP284' and `ebcdic-cp-es' are aliases for this charset.  source:
  722.      IBM NLS RM Vol2 SE09-8002-01, March 1990
  723.  
  724. `IBM285'
  725.      `CP285' and `ebcdic-cp-gb' are aliases for this charset.  source:
  726.      IBM NLS RM Vol2 SE09-8002-01, March 1990
  727.  
  728. `IBM290'
  729.      `EBCDIC-JP-kana' and `cp290' are aliases for this charset.
  730.      source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990
  731.  
  732. `IBM297'
  733.      `cp297' and `ebcdic-cp-fr' are aliases for this charset.  source:
  734.      IBM NLS RM Vol2 SE09-8002-01, March 1990
  735.  
  736. `IBM420'
  737.      `cp420' and `ebcdic-cp-ar1' are aliases for this charset.  source:
  738.      IBM NLS RM Vol2 SE09-8002-01, March 1990 IBM NLS RM p 11-11
  739.  
  740. `IBM423'
  741.      `cp423' and `ebcdic-cp-gr' are aliases for this charset.  source:
  742.      IBM NLS RM Vol2 SE09-8002-01, March 1990
  743.  
  744. `IBM424'
  745.      `cp424' and `ebcdic-cp-he' are aliases for this charset.  source:
  746.      IBM NLS RM Vol2 SE09-8002-01, March 1990
  747.  
  748. `IBM437'
  749.      `437' and `cp437' are aliases for this charset.  source: IBM NLS
  750.      RM Vol2 SE09-8002-01, March 1990
  751.  
  752. `IBM500'
  753.      `CP500', `ebcdic-cp-be' and `ebcdic-cp-ch' are aliases for this
  754.      charset.  source: IBM NLS RM Vol2 SE09-8002-01, March 1990
  755.  
  756. `IBM850'
  757.      `850' and `cp850' are aliases for this charset.  source: IBM NLS
  758.      RM Vol2 SE09-8002-01, March 1990
  759.  
  760. `IBM851'
  761.      `851' and `cp851' are aliases for this charset.  source: IBM NLS
  762.      RM Vol2 SE09-8002-01, March 1990
  763.  
  764. `IBM852'
  765.      `852' and `cp852' are aliases for this charset.  source: IBM NLS
  766.      RM Vol2 SE09-8002-01, March 1990
  767.  
  768. `IBM855'
  769.      `855' and `cp855' are aliases for this charset.  source: IBM NLS
  770.      RM Vol2 SE09-8002-01, March 1990
  771.  
  772. `IBM857'
  773.      `857' and `cp857' are aliases for this charset.  source: IBM NLS
  774.      RM Vol2 SE09-8002-01, March 1990
  775.  
  776. `IBM860'
  777.      `860' and `cp860' are aliases for this charset.  source: IBM NLS
  778.      RM Vol2 SE09-8002-01, March 1990
  779.  
  780. `IBM861'
  781.      `861', `cp-is' and `cp861' are aliases for this charset.  source:
  782.      IBM NLS RM Vol2 SE09-8002-01, March 1990
  783.  
  784. `IBM862'
  785.      `862' and `cp862' are aliases for this charset.  source: IBM NLS
  786.      RM Vol2 SE09-8002-01, March 1990
  787.  
  788. `IBM863'
  789.      `863' and `cp863' are aliases for this charset.  source: IBM
  790.      Keyboard layouts and code pages, PN 07G4586 June 1991
  791.  
  792. `IBM864'
  793.      `cp864' is an alias for this charset.  source: IBM Keyboard
  794.      layouts and code pages, PN 07G4586 June 1991
  795.  
  796. `IBM865'
  797.      `865' and `cp865' are aliases for this charset.  source: IBM DOS
  798.      3.3 Ref (Abridged), 94X9575 (Feb 1987)
  799.  
  800. `IBM868'
  801.      `CP868' and `cp-ar' are aliases for this charset.  source: IBM NLS
  802.      RM Vol2 SE09-8002-01, March 1990
  803.  
  804. `IBM869'
  805.      `869', `cp-gr' and `cp869' are aliases for this charset.  source:
  806.      IBM Keyboard layouts and code pages, PN 07G4586 June 1991
  807.  
  808. `IBM870'
  809.      `CP870', `ebcdic-cp-roece' and `ebcdic-cp-yu' are aliases for this
  810.      charset.  source: IBM NLS RM Vol2 SE09-8002-01, March 1990
  811.  
  812. `IBM871'
  813.      `CP871' and `ebcdic-cp-is' are aliases for this charset.  source:
  814.      IBM NLS RM Vol2 SE09-8002-01, March 1990
  815.  
  816. `IBM880'
  817.      `EBCDIC-Cyrillic' and `cp880' are aliases for this charset.
  818.      source: IBM NLS RM Vol2 SE09-8002-01, March 1990
  819.  
  820. `IBM891'
  821.      `cp891' is an alias for this charset.  source: IBM NLS RM Vol2
  822.      SE09-8002-01, March 1990
  823.  
  824. `IBM903'
  825.      `cp903' is an alias for this charset.  source: IBM NLS RM Vol2
  826.      SE09-8002-01, March 1990
  827.  
  828. `IBM904'
  829.      `904' and `cp904' are aliases for this charset.  source: IBM NLS
  830.      RM Vol2 SE09-8002-01, March 1990
  831.  
  832. `IBM905'
  833.      `CP905' and `ebcdic-cp-tr' are aliases for this charset.  source:
  834.      IBM 3174 Character Set Ref, GA27-3831-02, March 1990
  835.  
  836. `IBM918'
  837.      `CP918' and `ebcdic-cp-ar2' are aliases for this charset.  source:
  838.      IBM NLS RM Vol2 SE09-8002-01, March 1990
  839.  
  840. `IEC_P27-1'
  841.      `iso-ir-143' is an alias for this charset.  source: ECMA registry
  842.  
  843. `INIS'
  844.      `iso-ir-49' is an alias for this charset.  source: ECMA registry
  845.  
  846. `INIS-8'
  847.      `iso-ir-50' is an alias for this charset.  source: ECMA registry
  848.  
  849. `INIS-cyrillic'
  850.      `iso-ir-51' is an alias for this charset.  source: ECMA registry
  851.  
  852. `INVARIANT'
  853. `ISO_10367-box'
  854.      `iso-ir-155' is an alias for this charset.  source: ECMA registry
  855.  
  856. `ISO_2033-1983'
  857.      `e13b' and `iso-ir-98' are aliases for this charset.  source: ECMA
  858.      registry
  859.  
  860. `ISO_5427'
  861.      `iso-ir-37' is an alias for this charset.  source: ECMA registry
  862.  
  863. `ISO_5427:1981'
  864.      `iso-ir-54' is an alias for this charset.  source: ECMA registry
  865.  
  866. `ISO_5428:1980'
  867.      `iso-ir-55' is an alias for this charset.  source: ECMA registry
  868.  
  869. `ISO_646.basic:1983'
  870.      `ref' is an alias for this charset.  source: ECMA registry
  871.  
  872. `ISO_646.irv:1983'
  873.      `irv' and `iso-ir-2' are aliases for this charset.  source: ECMA
  874.      registry
  875.  
  876. `ISO_6937-2-25'
  877.      `iso-ir-152' is an alias for this charset.  source: ECMA registry
  878.  
  879. `ISO_8859-1:1987'
  880.      `CP819', `IBM819', `ISO-8859-1', `ISO_8859-1', `iso-ir-100', `l1'
  881.      and `latin1' are aliases for this charset.  source: ECMA registry
  882.  
  883. `ISO_8859-2:1987'
  884.      `ISO-8859-2', `ISO_8859-2', `iso-ir-101', `l2' and `latin2' are
  885.      aliases for this charset.  source: ECMA registry
  886.  
  887. `ISO_8859-3:1988'
  888.      `ISO-8859-3', `ISO_8859-3', `iso-ir-109', `l3' and `latin3' are
  889.      aliases for this charset.  source: ECMA registry
  890.  
  891. `ISO_8859-4:1988'
  892.      `ISO-8859-4', `ISO_8859-4', `iso-ir-110', `l4' and `latin4' are
  893.      aliases for this charset.  source: ECMA registry
  894.  
  895. `ISO_8859-5:1988'
  896.      `ISO-8859-5', `ISO_8859-5', `cyrillic' and `iso-ir-144' are
  897.      aliases for this charset.  source: ECMA registry
  898.  
  899. `ISO_8859-6:1987'
  900.      `ASMO-708', `ECMA-114', `ISO-8859-6', `ISO_8859-6', `arabic' and
  901.      `iso-ir-127' are aliases for this charset.  source: ECMA registry
  902.  
  903. `ISO_8859-7:1987'
  904.      `ECMA-118', `ELOT_928', `ISO-8859-7', `ISO_8859-7', `greek',
  905.      `greek8' and `iso-ir-126' are aliases for this charset.  source:
  906.      ECMA registry
  907.  
  908. `ISO_8859-8:1988'
  909.      `ISO-8859-8', `ISO_8859-8', `hebrew' and `iso-ir-138' are aliases
  910.      for this charset.  source: ECMA registry
  911.  
  912. `ISO_8859-9:1989'
  913.      `ISO-8859-9', `ISO_8859-9', `iso-ir-148', `l5' and `latin5' are
  914.      aliases for this charset.  source: ECMA registry
  915.  
  916. `ISO_8859-supp'
  917.      `iso-ir-154' and `latin1-2-5' are aliases for this charset.
  918.      source: ECMA registry
  919.  
  920. `IT'
  921.      `ISO646-IT' and `iso-ir-15' are aliases for this charset.  source:
  922.      ECMA registry
  923.  
  924. `JIS_C6220-1969-jp'
  925.      `JIS_C6220-1969', `iso-ir-13', `katakana' and `x0201-7' are
  926.      aliases for this charset.  source: ECMA registry
  927.  
  928. `JIS_C6220-1969-ro'
  929.      `ISO646-JP', `iso-ir-14' and `jp' are aliases for this charset.
  930.      source: ECMA registry
  931.  
  932. `JIS_C6229-1984-a'
  933.      `jp-ocr-a' is an alias for this charset.  source: ECMA registry
  934.  
  935. `JIS_C6229-1984-b'
  936.      `ISO646-JP-OCR-B' and `jp-ocr-b' are aliases for this charset.
  937.      source: ECMA registry
  938.  
  939. `JIS_C6229-1984-b-add'
  940.      `iso-ir-93' and `jp-ocr-b-add' are aliases for this charset.
  941.      source: ECMA registry
  942.  
  943. `JIS_C6229-1984-hand'
  944.      `iso-ir-94' and `jp-ocr-hand' are aliases for this charset.
  945.      source: ECMA registry
  946.  
  947. `JIS_C6229-1984-hand-add'
  948.      `iso-ir-95' and `jp-ocr-hand-add' are aliases for this charset.
  949.      source: ECMA registry
  950.  
  951. `JIS_C6229-1984-kana'
  952.      `iso-ir-96' is an alias for this charset.  source: ECMA registry
  953.  
  954. `JIS_X0201'
  955.      `X0201' is an alias for this charset.
  956.  
  957. `JUS_I.B1.002'
  958.      `ISO646-YU', `iso-ir-141', `js' and `yu' are aliases for this
  959.      charset.  source: ECMA registry
  960.  
  961. `JUS_I.B1.003-mac'
  962.      `iso-ir-147' and `macedonian' are aliases for this charset.
  963.      source: ECMA registry
  964.  
  965. `JUS_I.B1.003-serb'
  966.      `iso-ir-146' and `serbian' are aliases for this charset.  source:
  967.      ECMA registry
  968.  
  969. `KSC5636'
  970.      `ISO646-KR' is an alias for this charset.
  971.  
  972. `Latin-greek-1'
  973.      `iso-ir-27' is an alias for this charset.  source: ECMA registry
  974.  
  975. `MSZ_7795.3'
  976.      `ISO646-HU', `hu' and `iso-ir-86' are aliases for this charset.
  977.      source: ECMA registry
  978.  
  979. `NATS-DANO'
  980.      `iso-ir-9-1' is an alias for this charset.  source: ECMA registry
  981.  
  982. `NATS-DANO-ADD'
  983.      `iso-ir-9-2' is an alias for this charset.  source: ECMA registry
  984.  
  985. `NATS-SEFI'
  986.      `iso-ir-8-1' is an alias for this charset.  source: ECMA registry
  987.  
  988. `NATS-SEFI-ADD'
  989.      `iso-ir-8-2' is an alias for this charset.  source: ECMA registry
  990.  
  991. `NC_NC00-10:81'
  992.      `ISO646-CU', `cuba' and `iso-ir-151' are aliases for this charset.
  993.      source: ECMA registry
  994.  
  995. `NF_Z_62-010'
  996.      `ISO646-FR', `fr' and `iso-ir-69' are aliases for this charset.
  997.      source: ECMA registry
  998.  
  999. `NF_Z_62-010_(1973)'
  1000.      `ISO646-FR1' and `iso-ir-25' are aliases for this charset.
  1001.      source: ECMA registry
  1002.  
  1003. `NS_4551-1'
  1004.      `ISO646-NO', `iso-ir-60' and `no' are aliases for this charset.
  1005.      source: ECMA registry
  1006.  
  1007. `NS_4551-2'
  1008.      `ISO646-NO2', `iso-ir-61' and `no2' are aliases for this charset.
  1009.      source: ECMA registry
  1010.  
  1011. `PT'
  1012.      `ISO646-PT' and `iso-ir-16' are aliases for this charset.  source:
  1013.      ECMA registry
  1014.  
  1015. `PT2'
  1016.      `ISO646-PT2' and `iso-ir-84' are aliases for this charset.
  1017.      source: ECMA registry
  1018.  
  1019. `SEN_850200_B'
  1020.      `FI', `ISO646-FI', `ISO646-SE', `iso-ir-10' and `se' are aliases
  1021.      for this charset.  source: ECMA registry
  1022.  
  1023. `SEN_850200_C'
  1024.      `ISO646-SE2', `iso-ir-11' and `se2' are aliases for this charset.
  1025.      source: ECMA registry
  1026.  
  1027. `T.61-7bit'
  1028.      `iso-ir-102' is an alias for this charset.  source: ECMA registry
  1029.  
  1030. `dk-us'
  1031. `greek-ccitt'
  1032.      `iso-ir-150' is an alias for this charset.  source: ECMA registry
  1033.  
  1034. `greek7'
  1035.      `iso-ir-88' is an alias for this charset.  source: ECMA registry
  1036.  
  1037. `greek7-old'
  1038.      `iso-ir-18' is an alias for this charset.  source: ECMA registry
  1039.  
  1040. `hp-roman8'
  1041.      `r8' and `roman8' are aliases for this charset.  source: LaserJet
  1042.      IIP Printer User's Manual, HP part no 33471-90901, Hewlet-Packard,
  1043.      June 1989.
  1044.  
  1045. `latin-greek'
  1046.      `iso-ir-19' is an alias for this charset.  source: ECMA registry
  1047.  
  1048. `latin-lap'
  1049.      `iso-ir-158' and `lap' are aliases for this charset.  source: ECMA
  1050.      registry
  1051.  
  1052. `latin6'
  1053.      `iso-ir-157' and `l6' are aliases for this charset.  source: ECMA
  1054.      registry
  1055.  
  1056. `macintosh'
  1057.      `mac' is an alias for this charset.  source: The Unicode Standard
  1058.      ver1.0, ISBN 0-201-56788-1, Oct 1991
  1059.  
  1060. `us-dk'
  1061.      for compatibility with ASCII
  1062.  
  1063.  
  1064. Charsets based on ASCII
  1065. ***********************
  1066.  
  1067.  
  1068. Usual ASCII
  1069. ===========
  1070.  
  1071.    This charset is available in `recode' under the name `ASCII'.  In
  1072. fact, it's true name is `ANSI_X3.4-1968' as per RFC 1345, accepted
  1073. aliases being `ANSI_X3.4-1986', `ASCII', `IBM367', `ISO646-US',
  1074. `ISO_646.irv:1991', `US-ASCII', `cp367', `iso-ir-6' and `us'.  The
  1075. shortest way of specifying it in `recode' is `us'.
  1076.  
  1077.    This documentation used to include ASCII tables.  They have been
  1078. removed since `recode' can now recreate these (and a lot of others)
  1079. easily:
  1080.  
  1081.      recode -lf us                   for commented ASCII
  1082.      recode -ld us                   for concise decimal table
  1083.      recode -lo us                   for concise octal table
  1084.      recode -lh us                   for concise hexadecimal table
  1085.  
  1086.  
  1087. ASCII extended by Latin Alphabets
  1088. =================================
  1089.  
  1090.    This charset is available in `recode' under the name `Latin-1'.  In
  1091. fact, it's true name is `ISO_8859-1:1987' as per RFC 1345, accepted
  1092. aliases being `CP819', `IBM819', `ISO-8859-1', `ISO_8859-1',
  1093. `iso-ir-100', `l1' and `Latin-1'.  The shortest way of specifying it in
  1094. `recode' is `l1'.
  1095.  
  1096.    This charset corresponds to the ISO Latin Alphabet 1.  It is an
  1097. eight-bit code which coincides with ASCII for the lower half.
  1098.  
  1099.    This documentation used to include Latin-1 tables.  They have been
  1100. removed since `recode' can now recreate these (and a lot of others)
  1101. easily:
  1102.  
  1103.      recode -lf l1                   for commented ISO Latin-1
  1104.      recode -ld l1                   for concise decimal table
  1105.      recode -lo l1                   for concise octal table
  1106.      recode -lh l1                   for concise hexadecimal table
  1107.  
  1108.    The following from `lasko@video.dec.com' (Tim Lasko), with no date.
  1109.  
  1110.      ISO Latin-1, or more completely ISO Latin Alphabet No 1, is now an
  1111.      international standard as of February 1987 (IS 8859, Part 1).  For
  1112.      those American USEnet'rs that care, the 8-bit ASCII standard,
  1113.      which is essentially the same code, is going through the final
  1114.      administrative processes prior to publication.
  1115.  
  1116.      ISO Latin-1 (IS 8859/1) is actually one of an entire family of
  1117.      eight-bit one-byte character sets, all having ASCII on the left
  1118.      hand side, and with varying repertoires on the right hand side:
  1119.  
  1120.   1. Latin Alphabet No 1 (caters to Western Europe - now approved).
  1121.  
  1122.   2. Latin Alphabet No 2 (caters to Eastern Europe - now approved).
  1123.  
  1124.   3. Latin Alphabet No 3 (caters to SE Europe + others - in draft
  1125.      ballot).
  1126.  
  1127.   4. Latin Alphabet No 4 (caters to Northern Europe - in draft ballot).
  1128.  
  1129.   5. Latin-Cyrillic alphabet (right half all Cyrillic - processing
  1130.      currently suspended pending USSR input).
  1131.  
  1132.   6. Latin-Arabic alphabet (right half all Arabic - now approved).
  1133.  
  1134.   7. Latin-Greek alphabet (right half Greek + symbols - in draft
  1135.      ballot).
  1136.  
  1137.   8. Latin-Hebrew alphabet (right half Hebrew + symbols - proposed).
  1138.  
  1139.  
  1140. ASCII 7-bits, BS to overstrike
  1141. ==============================
  1142.  
  1143.    This charset is available in `recode' under the name `ASCII-BS',
  1144. with `BS' as an acceptable alias.
  1145.  
  1146.    The file is straight ASCII, seven bits only.  According to the
  1147. definition of ASCII: diacritics are applied by a sequence of three
  1148. characters: the letter, one BS, the diacritic mark.  We deviate
  1149. slightly from this by exchanging the diacritic mark and the letter so,
  1150. on a screen device, the diacritic will disappear and let the letter
  1151. alone.  At recognition time, both methods are acceptable.
  1152.  
  1153.    The French quotes are coded by the sequences: `< BS "' or `" BS <'
  1154. for the opening quote and `> BS "' or `" BS >' for the closing quote.
  1155. This artificial convention was inherited in straight `ASCII-BS' from
  1156. habits around `Bang-Bang' entry, and is not well known.  But we decided
  1157. to stick to it so that `ASCII-BS' charset will not loose French quotes.
  1158.  
  1159.    The `ASCII-BS' charset is independent of `ASCII', and different.
  1160. The following examples demonstrate this, knowing at advance that `!2'
  1161. is the `Bang-Bang' way of representing an `e' with an acute accent.
  1162. Compare:
  1163.  
  1164.      % echo \!2 | recode -v bang:us | od -bc
  1165.      Bang-Bang -> ISO_8859-1:1987 -> RFC 1345 -> ANSI_X3.4-1968 (many to one)
  1166.      Simplified to: Bang-Bang -> ISO_8859-1:1987 -> ANSI_X3.4-1968 (many to one)
  1167.      0000000 351 012
  1168.              351  \n
  1169.      0000002
  1170.  
  1171. with:
  1172.  
  1173.      % echo \!2 | recode -v bang:bs | od -bc
  1174.      Bang-Bang -> ISO_8859-1:1987 -> ASCII-BS (many to many)
  1175.      0000000 047 010 145 012
  1176.                '  \b   e  \n
  1177.      0000004
  1178.  
  1179.    In the first case, the `e' with an acute accent is merely
  1180. transmitted by the `Latin-1:ASCII' mapping, not having a special
  1181. recoding rule for it.  In the `Latin-1:ASCII-BS' case, the acute accent
  1182. is applied over the `e' with a backspace: diacriticized characters have
  1183. special rules.  For the `ASCII-BS' charset, reversibility is still
  1184. possible, but there might be difficult cases.
  1185.  
  1186.  
  1187. ASCII without diacritics nor underline
  1188. ======================================
  1189.  
  1190.    This charset is available in `recode' under the name `flat'.
  1191.  
  1192.    This code is ASCII expunged of all diacritics and underlines, as
  1193. long as they are applied using three character sequences, with BS in the
  1194. middle.  Also, despite slightly unrelated, each control character is
  1195. represented by a sequence of two or three graphic characters.  The
  1196. newline character, however, keeps its functionality and is not
  1197. represented.
  1198.  
  1199.    Note that charset `flat' is a terminal charset.  We can convert *to*
  1200. `flat', but not *from* it.
  1201.  
  1202.  
  1203. Charsets based on IBM
  1204. *********************
  1205.  
  1206.  
  1207. EBCDIC code
  1208. ===========
  1209.  
  1210.    This charset is the IBM's external binary coded decimal for
  1211. interchange coding.  This is an eight bits code.  The following three
  1212. variants were implemented in GNU `recode' independently of RFC 1345:
  1213.  
  1214. `EBCDIC'
  1215.      GNU `recode' `us:ebcdic' conversion is identical to GNU `dd'
  1216.      `ebcdic' conversion, and `recode' `ebcdic:us' conversion is
  1217.      identical to GNU `dd' `ascii' conversion.  This charset also
  1218.      represents the way Control Data Corporation relates EBCDIC to
  1219.      8-bits ASCII.
  1220.  
  1221. `EBCDIC-CCC'
  1222.      GNU `recode' `us:ebcdic-ccc' or `ebcdic-ccc:us' conversions
  1223.      represent the way Concurrent Computer Corporation (formerly Perkin
  1224.      Elmer) relates EBCDIC to 8-bits ASCII.
  1225.  
  1226. `EBCDIC-IBM'
  1227.      GNU `recode' `us:ebcdic-ibm' conversion is *almost* identical to
  1228.      GNU `dd' `ibm' conversion.  Given the exact `dd' `ibm' conversion
  1229.      table, `recode' once said:
  1230.  
  1231.           Codes  91 and 213 both recode to 173
  1232.           Codes  93 and 229 both recode to 189
  1233.           No character recodes to  74
  1234.           No character recodes to 106
  1235.  
  1236.      So I arbitrarily chose to recode 213 by 74 and 229 by 106.  This
  1237.      makes the `EBCDIC-IBM' recoding reversible, but this is not
  1238.      necessarily the best correction.  In any case, I believe GNU `dd'
  1239.      should be corrected, and preferably, GNU `dd' and GNU `recode'
  1240.      should agree on the same correction.  So, this table may change
  1241.      once again.
  1242.  
  1243.    RFC 1345 brings in `recode' 15 other EBCDIC charsets, and 21 other
  1244. charsets having EBCDIC in at least one of their alias names.  You can
  1245. get a list of all these by executing:
  1246.  
  1247.      recode -l | grep ebcdic
  1248.  
  1249.  
  1250. IBM's PC code
  1251. =============
  1252.  
  1253.    This charset is available in `recode' under the name `IBM-PC'.
  1254. There are a few discrepancies between this charset and the very similar
  1255. RFC 1345 charset `ibm437', which have not been analyzed yet, so the
  1256. charsets are being kept separate for now.  This might change in the
  1257. future.
  1258.  
  1259.    The file was obtained or is aimed towards a PC microcomputer from
  1260. IBM or any compatible.  This is an eight-bit code.
  1261.  
  1262.  
  1263. Unisys' ICON code
  1264. =================
  1265.  
  1266.    This charset is available in `recode' under the name `Icon-QNX',
  1267. with `QNX' as an acceptable alias.
  1268.  
  1269.    The file is using Unisys' Icon way to represent diacritics with code
  1270. 25 escape sequences, under the system QNX.  This is a seven-bit code,
  1271. even if eight-bit codes can flow through as part of IBM-PC charset.
  1272.  
  1273.  
  1274. Charsets based on CDC
  1275. *********************
  1276.  
  1277.  
  1278. Control Data's Display Code
  1279. ===========================
  1280.  
  1281.    This code is not available in `recode', but repeated here for
  1282. reference.  This is a 6-bit code used on CDC mainframes.
  1283.  
  1284.      Octal display code to graphic       Octal display code to octal ASCII
  1285.      
  1286.      00  :    20  P    40  5   60  #     00 072  20 120  40 065  60 043
  1287.      01  A    21  Q    41  6   61  [     01 101  21 121  41 066  61 133
  1288.      02  B    22  R    42  7   62  ]     02 102  22 122  42 067  62 135
  1289.      03  C    23  S    43  8   63  %     03 103  23 123  43 070  63 045
  1290.      04  D    24  T    44  9   64  "     04 104  24 124  44 071  64 042
  1291.      05  E    25  U    45  +   65  _     05 105  25 125  45 053  65 137
  1292.      06  F    26  V    46  -   66  !     06 106  26 126  46 055  66 041
  1293.      07  G    27  W    47  *   67  &     07 107  27 127  47 052  67 046
  1294.      10  H    30  X    50  /   70  '     10 110  30 130  50 057  70 047
  1295.      11  I    31  Y    51  (   71  ?     11 111  31 131  51 050  71 077
  1296.      12  J    32  Z    52  )   72  <     12 112  32 132  52 051  72 074
  1297.      13  K    33  0    53  $   73  >     13 113  33 060  53 044  73 076
  1298.      14  L    34  1    54  =   74  @     14 114  34 061  54 075  74 100
  1299.      15  M    35  2    55      75  \     15 115  35 062  55 040  75 134
  1300.      16  N    36  3    56  ,   76  ^     16 116  36 063  56 054  76 136
  1301.      17  O    37  4    57  .   77  ;     17 117  37 064  57 056  77 073
  1302.  
  1303.  
  1304. ASCII 6/12 from NOS
  1305. ===================
  1306.  
  1307.    This charset is available in `recode' under the name `CDC-NOS', with
  1308. `NOS' as an acceptable alias.
  1309.  
  1310.    This is one of the charset in use on CDC Cyber NOS systems to
  1311. represent ASCII, sometimes named "NOS 6/12" code for coding ASCII.
  1312. This code is also known as "caret ASCII".  It is based on a six bits
  1313. character set in which small letters and control characters are coded
  1314. using a `^' escape and, sometimes, a `@' escape.
  1315.  
  1316.    The routines given here presume that the six bits code is already
  1317. expressed in ASCII by the communication channel, with embedded ASCII
  1318. `^' and `@' escapes.
  1319.  
  1320.    Here is a table showing which characters are being used to encode
  1321. each ASCII character.
  1322.  
  1323.      000  ^5  020  ^#  040     060  0  100 @A  120  P  140  @G  160  ^P
  1324.      001  ^6  021  ^[  041  !  061  1  101  A  121  Q  141  ^A  161  ^Q
  1325.      002  ^7  022  ^]  042  "  062  2  102  B  122  R  142  ^B  162  ^R
  1326.      003  ^8  023  ^%  043  #  063  3  103  C  123  S  143  ^C  163  ^S
  1327.      004  ^9  024  ^"  044  $  064  4  104  D  124  T  144  ^D  164  ^T
  1328.      005  ^+  025  ^_  045  %  065  5  105  E  125  U  145  ^E  165  ^U
  1329.      006  ^-  026  ^!  046  &  066  6  106  F  126  V  146  ^F  166  ^V
  1330.      007  ^*  027  ^&  047  '  067  7  107  G  127  W  147  ^G  167  ^W
  1331.      010  ^/  030  ^'  050  (  070  8  110  H  130  X  150  ^H  170  ^X
  1332.      011  ^(  031  ^?  051  )  071  9  111  I  131  Y  151  ^I  171  ^Y
  1333.      012  ^)  032  ^<  052  *  072 @D  112  J  132  Z  152  ^J  172  ^Z
  1334.      013  ^$  033  ^>  053  +  073  ;  113  K  133  [  153  ^K  173  ^0
  1335.      014  ^=  034  ^@  054  ,  074  <  114  L  134  \  154  ^L  174  ^1
  1336.      015  ^   035  ^\  055  -  075  =  115  M  135  ]  155  ^M  175  ^2
  1337.      016  ^,  036  ^^  056  .  076  >  116  N  136 @B  156  ^N  176  ^3
  1338.      017  ^.  037  ^;  057  /  077  ?  117  O  137  _  157  ^O  177  ^4
  1339.  
  1340.  
  1341. ASCII "bang bang"
  1342. =================
  1343.  
  1344.    This charset is available in `recode' under the name `Bang-Bang'.
  1345.  
  1346.    This is the local code in use on Cybers at Universite de Montreal,
  1347. which grave and serious people there prefer to name "ASCII code
  1348. display".  This code is also known as "Bang-bang".  It is based on a
  1349. six bits character set in which capitals, French diacritics and a few
  1350. others are coded using an `!' escape followed by a single character, and
  1351. control characters using a double `!' escape followed by a single
  1352. character.
  1353.  
  1354.    The routines given here presume that the six bits code is already
  1355. expressed in ASCII by the communication channel, with embedded ASCII `!'
  1356. escapes.
  1357.  
  1358.    Here is a table showing which characters are being used to encode
  1359. each ASCII character.
  1360.  
  1361.      000 !!@  020 !!P  040    060 0  100 @   120 !P  140 !@ 160 P
  1362.      001 !!A  021 !!Q  041 !" 061 1  101 !A  121 !Q  141 A  161 Q
  1363.      002 !!B  022 !!R  042 "  062 2  102 !B  122 !R  142 B  162 R
  1364.      003 !!C  023 !!S  043 #  063 3  103 !C  123 !S  143 C  163 S
  1365.      004 !!D  024 !!T  044 $  064 4  104 !D  124 !T  144 D  164 T
  1366.      005 !!E  025 !!U  045 %  065 5  105 !E  125 !U  145 E  165 U
  1367.      006 !!F  026 !!V  046 &  066 6  106 !F  126 !V  146 F  166 V
  1368.      007 !!G  027 !!W  047 '  067 7  107 !G  127 !W  147 G  167 W
  1369.      010 !!H  030 !!X  050 (  070 8  110 !H  130 !X  150 H  170 X
  1370.      011 !!I  031 !!Y  051 )  071 9  111 !I  131 !Y  151 I  171 Y
  1371.      012 !!J  032 !!Z  052 *  072 :  112 !J  132 !Z  152 J  172 Z
  1372.      013 !!K  033 !![  053 +  073 ;  113 !K  133 [   153 K  173 ![
  1373.      014 !!L  034 !!\  054 ,  074 <  114 !L  134 \   154 L  174 !\
  1374.      015 !!M  035 !!]  055 -  075 =  115 !M  135 ]   155 M  175 !]
  1375.      016 !!N  036 !!^  056 .  076 >  116 !N  136 ^   156 N  176 !^
  1376.      017 !!O  037 !!_  057 /  077 ?  117 !O  137 _   157 O  177 !_
  1377.  
  1378.  
  1379. Non-IBM micro-computer charsets
  1380. *******************************
  1381.  
  1382.  
  1383. Apple's Macintosh code
  1384. ======================
  1385.  
  1386.    This charset is available in `recode' under the name `Apple-Mac'.
  1387. There are a few discrepancies between this charset and the very similar
  1388. RFC 1345 charset `macintosh', which have not been analyzed yet, so the
  1389. charsets are being kept separate for now.  This might change in the
  1390. future.
  1391.  
  1392.    The file has been obtained or is aimed to a Macintosh micro-computer
  1393. from Apple.  This is an eight bit code.  The file is the data fork only.
  1394.  
  1395.  
  1396. Atari ST code
  1397. =============
  1398.  
  1399.    This charset is available in `recode' under the name `AtariST'.
  1400.  
  1401.    This is the character set used on the Atari ST/TT/Falcon.  This is
  1402. similar to `IBM-PC', but differs in some details (includes some more
  1403. accented characters, the graphic characters are mostly replaced by
  1404. hebrew characters, and there is a true German sharp s different from
  1405. Greek beta).
  1406.  
  1407.    About the end-of-line conversions: the canonical end-of-line on the
  1408. Atari is `\r\n', but unlike `IBM-PC', the OS makes no difference
  1409. between text and binary input/output; it is up to the application how
  1410. to interpret the data.  In fact, most of the libraries that come with
  1411. compilers can grok both `\r\n' and `\n' as end of lines.  Many of the
  1412. users who also have access to Unix systems prefer `\n' to ease porting
  1413. Unix utilities.  So, for easing reversibility, `recode' tries to let
  1414. `\r' undisturbed through recodings.
  1415.  
  1416.  
  1417. NeXT international code
  1418. =======================
  1419.  
  1420.    This charset is available in `recode' under the name `NeXT'.
  1421.  
  1422.    The NeXT encoding is an extension to the ISO Latin-1 ASCII encoding
  1423. used by NeXT under the system NeXTSTEP.  It is identical to Latin-1 for
  1424. the positions 0-127.  In the position 128-255, NeXT added some chars and
  1425. shuffled them around a little bit (for some unknown reason).
  1426.  
  1427.  
  1428. Some other charsets
  1429. *******************
  1430.  
  1431.    Even if these charsets were originally added to `recode' for
  1432. handling texts written in French, they find other uses.  We did use them
  1433. lot for writing French diacriticized texts in the past, so `recode'
  1434. knows how to handle these particularly well for French texts.
  1435.  
  1436.  
  1437. ASCII with LaTeX codes
  1438. ======================
  1439.  
  1440.    This charset is available in `recode' under the name `LaTeX' and has
  1441. `ltex' as an alias.  It is used for ASCII files coded to be read by
  1442. LaTeX or, in certain cases, by TeX.
  1443.    Whenever you recode from another charset to `LaTeX', beware that all
  1444. occurrences of backslashes `\' are usually translated into the string
  1445. `\backslash{}'.  However, in practice, people often use backslashes in
  1446. the other charset for introducing TeX commands, compromising it: it is
  1447. not pure TeX, nor it is pure other charset.  This translation of
  1448. backslashes into `\backslash{}' can be rather inconvenient, it may be
  1449. inhibited through the command option `-d'.
  1450.  
  1451.  
  1452. ASCII with easy French conventions
  1453. ==================================
  1454.    This charset is available in `recode' under the name `Texte' and has
  1455. `txte' for an alias.
  1456.    This charset is a seven bits code, identical to `ASCII-BS', save for
  1457. French diacritics which are noted using a slightly different convention.
  1458.    At text entry time, these conventions provide a little speed up.  At
  1459. read time, they slightly improve the readability over a few alternate
  1460. ways of coding diacritics.  Of course, it would better to have a
  1461. specialized keyboard to make direct eight bits entries and fonts for
  1462. immediately displaying eight bit ISO Latin-1 characters.  But not
  1463. everybody is so fortunate.  In several mailing environments, the eight
  1464. bit is often willingfully destroyed.
  1465.    Easy French has been in use in France for a while.  I only slightly
  1466. adapted it (the diaeresis option) to make it more comfortable to several
  1467. usages in Qu'ebec originating from Universit'e de Montr'eal.  In fact,
  1468. the main problem for me was not to necessarily to invent Easy French,
  1469. but to recognize the "best" convention to use, (best is not being
  1470. defined, here) and to try to solve the main pitfalls associated with
  1471. the selected convention.
  1472.  
  1473.  
  1474. Diacritics
  1475. ----------
  1476.    French quotes (sometimes called "angle quotes") are noted the same
  1477. way English quotes are noted in TeX, *id est* by ```' and `'''.
  1478.    No effort has been put to preserve Latin ligatures (`ae', `oe')
  1479. which are representable in several other charsets.  So, these ligatures
  1480. may be lost through Easy French conventions.
  1481.    This is almost the French convention for simplified diacritics entry:
  1482.  
  1483. `e''
  1484.      Acute accent
  1485. `e`'
  1486.      Grave accent
  1487. `e^'
  1488.      Circumflex accent
  1489. `e"'
  1490.      Diaeresis
  1491. `c,'
  1492.      Cedilla
  1493.  
  1494.    In some countries, `:' is used instead of `"' to mark diaeresis.
  1495. `recode' support one convention on a single call, depending on the `-c'
  1496. option of the `recode' command.
  1497.    The convention is prone to loosing information, because the diacritic
  1498. meaning overloads some characters that already have other uses.  To
  1499. alleviate this, some knowledge of the French language is boosted into
  1500. the recognition routines.  So, the following subtleties are
  1501. systematically obeyed by the various recognizers.
  1502.  
  1503.    * A single quote which follows a `e' does not necessarily means an
  1504.      acute accent if it is followed by a single other one.  For example:
  1505.     `e''
  1506.           will give an `e' with an acute accent.
  1507.     `e'''
  1508.           will give a simple `e', with a closing quotation mark.
  1509.     `e''''
  1510.           will give an `e' with an acute accent, followed by a closing
  1511.           quotation mark.
  1512.      There is a problem induced by this convention if there are English
  1513.      quotations with a French text.  In sentences like:
  1514.           There's a meeting at Archie's restaurant.
  1515.      the single quotes will be mistaken twice for acute accents.  So
  1516.      English contractions and suffix possessives could be mangled.
  1517.    * A double quote or colon, depending on `-c' option, which follows a
  1518.      vowel is interpreted as diaeresis only if it is followed by another
  1519.      letter.  But there are in French several words that *end* with a
  1520.      diaeresis, the program also recognizes them.  *Note Ending
  1521.      diaeresis::, for a study of all the problematic cases.
  1522.    * A comma which follows a `c' is interpreted as a cedilla only if it
  1523.      is followed by one of the vowels `a', `o' and `u'.
  1524.  
  1525.  
  1526. List of words ending with diaeresis
  1527. -----------------------------------
  1528.    Here is a classification of all cases of a diaeresis at the end of a
  1529. French word:
  1530.  
  1531.    * Words ending in "igue"
  1532.         - Feminine words without a relative masculine: `besaigue"' and
  1533.           `cigue"'.
  1534.         - Feminine words with a relative masculine (1): `aigue"',
  1535.           `ambigue"', `contigue"', `exigue"', `subaigue"' and
  1536.           `suraigue"'.
  1537.    * Words not ending in "igue"
  1538.         - Ended by "i" (2): `ai"', `congai"', `goi"', `hai"kai"',
  1539.           `inoui"', `sai"', `samurai"', `thai"' and `tokai"'.
  1540.         - Ended by "e": `canoe"'.
  1541.         - Ended by "u" (3): `Esau"'.
  1542.  
  1543.    Notes:
  1544.  
  1545.   1. There are supposed to be seven words in this case.  So, one is
  1546.      missing.
  1547.   2. Look at one of the following sentences (the second has to be
  1548.      interpreted with the `-c' option):
  1549.           "Ai"e!  Voici le proble`me que j'ai"
  1550.           Ai:e!  Voici le proble`me que j'ai:
  1551.      There is an ambiguity between an `ai"', the small animal, and the
  1552.      indicative future of *avoir* (first person singular), when followed
  1553.      by what could be a diaeresis mark.  Hopefully, the case is solved
  1554.      by the fact that an apostrophe always precedes the verb and almost
  1555.      never the animal.
  1556.   3. I did not pay attention to proper nouns, but this one showed up as
  1557.      being fairly evident.
  1558.  
  1559.    Just to complete this topic, note that it would be wrong to make a
  1560. rule for all words ending in "igue" as needing a diaerisis.  Here are
  1561. counter-examples: `becfigue', `be`sigue', `bigue', `bordigue',
  1562. `bourdigue', `brigue', `contre-digue', `digue', `d'intrigue',
  1563. `fatigue', `figue', `garrigue', `gigue', `igue', `intrigue', `ligue',
  1564. `prodigue', `sarigue' and `zigue'.
  1565.  
  1566.  
  1567. World Wide Web representations
  1568. ==============================
  1569.    This charset is available in `recode' under the name `HTML' and has
  1570. `w3' and `WWW' for aliases.
  1571.    HTML texts used by World Wide Web limit themselves to 7-bit
  1572. characters internally, special sequences beginning with an ampersand
  1573. `&' and ending with a semicolon `;' are used for representing characters
  1574. from Latin-1 having the 8th bit set.
  1575.    When you recode from another charset to `HTML', beware that all
  1576. occurrences of ampersands are usually translated into the string
  1577. `&', similarly, left angle brackets `<' are translated into `<'
  1578. and right angle brackets `>' are translated into `>'.  However, in
  1579. practice, people often use ampersands and angle brackets in the other
  1580. charset for introducing HTML commands, compromising it: it is not pure
  1581. HTML, not it is pure other charset.  These three translations can be
  1582. rather inconvenient, they may be specifically inhibited through the
  1583. command option `-d'.
  1584.  
  1585.  
  1586. Internal aspects
  1587. ****************
  1588.    Suppose that four elementary steps are selected at path optimization
  1589. time.  Then `recode' will split itself into four different tasks
  1590. interconnected with pipes, logically equivalent to:
  1591.      STEP1 <INPUT | STEP2 | STEP3 | STEP4 >OUTPUT
  1592.  
  1593.  
  1594. Overall organization
  1595. ====================
  1596.    The main driver constructs, while initializing all conversion
  1597. modules, a table giving all the conversion routines available ("single
  1598. step"s) and for each, the starting charset and the ending charset.  If
  1599. we consider these charsets as being the nodes of a directed graph, each
  1600. single step may be considered as oriented arc from one node to the
  1601. other.  A cost is attributed to each arc: for example, a high penalty
  1602. is given to single steps which are prone to loosing characters, a low
  1603. penalty is given to those which need studying more than one input
  1604. character for producing an output character, etc.
  1605.    Given a starting code and a goal code, `recode' computes the most
  1606. economical route through the elementary recodings, that is, the best
  1607. sequence of conversions that will transform the input charset into the
  1608. final charset.  To speed up execution, `recode' looks for subsequences
  1609. of conversions which are simple enough to be merged, it then
  1610. dynamically creates new single steps for these mergings.
  1611.    A "double step" is a sequence of two single steps, the output of the
  1612. first being the special charset `rfc1345', the input of the second
  1613. single step being also `rfc1345'.  A special machinery dynamically
  1614. produces efficient, reversible, merge-able single steps out of these
  1615. double steps.
  1616.    The main part of `recode' is written in C, as are most single steps.
  1617. A few single steps need to recognize sequences of multiple characters,
  1618. they are often better written in `flex'.
  1619.  
  1620.  
  1621. Adding new charsets
  1622. ===================
  1623.    It is easy for a programmer to add a new charset to `recode'.  All
  1624. it requires is making a few functions kept in a single `.c' file,
  1625. adjusting `Makefile.in', and remaking `recode'.
  1626.    One of the function should convert from any previous charset to the
  1627. new one.  Any previous charset will do, but try to select it so you
  1628. will not loose too much information while converting.  The other
  1629. function should convert from the new charset to any older one.  You do
  1630. not have to select the same old charset than what you selected for the
  1631. previous routine.  Once again, select any charset for which you will
  1632. not loose too much information while converting.
  1633.    If, for any of these two functions, you have to read multiple bytes
  1634. of the old charset before recognizing the character to produce, you
  1635. might prefer programming it in `flex' in a separate `.l' file.
  1636. Prototype your C or `flex' files after one of those which exist
  1637. already, so to keep the sources uniform.  Besides, at `make' time, all
  1638. `.l' files are automatically merged into a single big one by the script
  1639. `mergelex.awk', which requires sources to follow some rules.  Mimetism
  1640. is a simple approach which relieves me of explaining all these rules!
  1641.    Each of your source files should have its own initialization
  1642. function, named `module_CHARSET', which is meant to be executed
  1643. quickly, once, prior to any recoding.  It should declare the name of
  1644. your charsets and the single steps (or elementary recodings) you
  1645. provide, by calling `declare_step' one or more times.  Besides the
  1646. charset names, `declare_step' expects a description of the recoding
  1647. quality (see `recode.h') and two functions you also provide.
  1648.    The first such function has the purpose of allocating structures,
  1649. preconditioning conversion tables, etc.  It is also the usual way of
  1650. further modifying the `STEP' structure.  This function is executed only
  1651. if and when the single step is retained in an actual recoding sequence.
  1652. If you do not need such delayed initialization, merely use `NULL' for
  1653. the function argument.
  1654.    The second function executes the elementary recoding on a whole file.
  1655. There are a few cases when you can spare writing this function:
  1656.  
  1657.    * Some single steps do nothing else than a pure copy of the input
  1658.      onto the output, in this case, you can use the predefined function
  1659.      `file_one_to_one', while having a delayed initialization for
  1660.      presetting the `STEP' field `one_to_one' to the predefined value
  1661.      `one_to_same'.
  1662.    * Some single steps are driven by a table which recodes one
  1663.      character into another; if the recoding does nothing else, you can
  1664.      use the predefined function `file_one_to_one', while having a
  1665.      delayed initialization for presetting the `STEP' field
  1666.      `one_to_one' with your table.
  1667.    * Some single steps are driven by a table which recodes one
  1668.      character into a string; if the recoding does nothing else, you
  1669.      can use the predefined function `file_one_to_many', while having a
  1670.      delayed initialization for presetting the `STEP' field
  1671.      `one_to_many' with your table.
  1672.  
  1673.    If you have a recoding table handy in a suitable format but do not
  1674. use one of the predefined recoding functions, it is still a good idea
  1675. to use a delayed initialization to save it anyway, because `recode'
  1676. option `-h' will take advantage of this information when available.
  1677.    Finally, edit `Makefile.in' to add the source file name of your
  1678. routines to the `C_STEPS' or `L_STEPS' macro definition, depending on
  1679. the fact your routines is written in C or in `flex'.  For C files only,
  1680. also modify the `STEPOBJS' macro definition.