NAME

    Jacode4e - Converts Character Encodings for Enterprise in Japan

SYNOPSIS

  use FindBin;
  use lib "$FindBin::Bin/lib";
  use Jacode4e;
 
  $char_count =
  Jacode4e::convert(\$line, $OUTPUT_encoding, $INPUT_encoding [, { %option }]);
 
    $char_count
      Count of characters in $line

    $line
    $OUTPUT_encoding
    $INPUT_encoding
      Converts encoding of $line from $INPUT_encoding to $OUTPUT_encoding then
      overwrites $line.
      $OUTPUT_encoding and $INPUT_encoding cannot omit.
      You can use mnemonic as encoding name of $INPUT_encoding and $OUTPUT_encoding:

      mnemonic      means
      -----------------------------------------------------------------------
      cp932x        CP932X, Extended CP932 to JIS X 0213 using 0x9C5A as single shift
      cp932         Microsoft CP932, IANA Windows-31J
      cp932ibm      IBM CP932
      cp932nec      NEC CP932
      sjis2004      JISC Shift_JIS-2004
      sjis          JISC Shift_JIS (JIS X 0201, JIS X 0208)
      euc2004       JISC EUC-JIS-2004 (JIS X 0201, JIS X 0213 plane 1 and plane 2)
      euc           JISC EUC-JP (JIS X 0201, JIS X 0208, JIS X 0212)
      jis2004       JISC ISO-2022-JP-2004 (JIS X 0201, JIS X 0213 plane 1 and plane 2)
      jis           JISC ISO-2022-JP (JIS X 0201, JIS X 0208, JIS X 0212)
      cp00930       IBM CP00930(CP00290+CP00300), CCSID 5026 katakana
      keis78        HITACHI KEIS78
      keis83        HITACHI KEIS83
      keis90        HITACHI KEIS90
      jef           FUJITSU JEF (12 point size for printing with option OUTPUT_SHIFTING)
      jef9p         FUJITSU JEF ( 9 point size for printing with option OUTPUT_SHIFTING)
      jipsj         NEC JIPS(J)
      jipse         NEC JIPS(E)
      letsj         UNISYS LetsJ
      utf8          UTF-8.0 (aka UTF-8)
      utf8.1        UTF-8.1 (conversion based on Shift_JIS-Unicode mapping, not CP932)
      utf8jp        UTF-8-SPUA-JP, JIS X 0213 on SPUA ordered by JIS level, plane, row, cell
      -----------------------------------------------------------------------

    { %option }
      Hash reference "{ %option }" can omit.
      You can following mnemonics as keys of hash reference "{ %option }":

      key mnemonic      value means
      -----------------------------------------------------------------------
      INPUT_LAYOUT      input record layout by 'S' and 'D' sequence
                        'S' means one char as SBCS, 'D' means one char as DBCS
                        each letter may optionally be followed by a number
                        indicating the repeat count, see samples
      OUTPUT_SHIFTING   true means use output shift code, false means not use
                        default is false
      SPACE             output space code in DBCS/MBCS
      GETA              output geta code in DBCS/MBCS
      OVERRIDE_MAPPING  hash reference of FROM => TO override mapping
                        { "\x12\x34"=>"\x56\x78", "\x9A\xBC"=>"\xDE\xFE", }
                        (CAUTION! override also SPACE option)
      ROUND_TRIP        true means round-trip (reversible) conversion
                        a character with no native code is allocated a
                        code point from the user-defined (GAIJI) area
                        default is false (ordinary Jacode4e conversion)
      -----------------------------------------------------------------------

    If you need round-trip conversion, specify the "ROUND_TRIP => 1" option
    (this is the same feature as the separate Jacode4e::RoundTrip module,
    now built into Jacode4e). The encodings that can be round-tripped are
    cp932x, cp00930, keis78, keis83, keis90, jef, jef9p, jipsj, jipse,
    letsj, utf8, utf8.1, and utf8jp.

    CAUTION: to round-trip, both "A to B" and "B to A" must specify
    "ROUND_TRIP => 1", and must use the SAME VERSION of Jacode4e, because
    the allocation order of the user-defined area depends on the data
    table of the version. If the versions differ, the round-trip is not
    guaranteed.

DEPENDENCIES

    perl version 5.005_03 to newest perl

