Jacode4e

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for this software.

2.13.6.23 2026-07-14 00:00:00
  - add 'sjis' encoding, JISC Shift_JIS (JIS X 0201 and JIS X 0208 only,
    CP932 extended characters are not converted, use 'cp932' for them)
    with the eras 'sjis1978' (JIS C 6226-1978), 'sjis1983' (JIS X
    0208-1983), 'sjis1990' (JIS X 0208-1990), 'sjis2000' (JIS X
    0213:2000), and 'sjis2004' (JIS X 0213:2004). The year-less 'sjis'
    is the 1990 era. The eras differ by the JIS C 6226-1978 versus JIS
    X 0208-1983 exchanged/relocated codes, the two kanji appended by
    JIS X 0208-1990 (U+51DC, U+7199), and the ten kanji appended by JIS
    X 0213:2004.
  - add 'euc' encoding, JISC EUC-JP (code set 0, 1, 2, and 3), with the
    eras 'euc1978', 'euc1983', 'euc1990', 'euc2000', and 'euc2004' (the
    year-less 'euc' is the 1990 era). 'euc' of each era is derived by
    encoding conversion from the 'sjis' column of the same era via
    men-ku-ten, so no new mapping data is added for code set 0, 1,
    and 2
  - support EUC-JP code set 3 (SS3 0x8F + JIS X 0212) input/output on
    'euc1990' (and so the year-less 'euc') for every character that

make__DATA__/make__DATA__.pl  view on Meta::CPAN

    }
    my $jis83gl = JISGL_by_SJIS($sjis1983);
    my $jis78gl = JIS78GL_by_JIS83GL($jis83gl);
    if (not defined $jis78gl) {      # unchanged between 1978 and 1983
        return $sjis1983;
    }
    if ($jis78gl eq q{}) {           # not in JIS C 6226-1978 (Category 1)
        return q{};
    }

    # A relocation is applied only when it is a two-way exchange (the
    # JIS C 6226-1978 "simplified and traditional exchanged" pairs of
    # Category 3, which are bidirectional in %JIS78GL_by_JIS83GL). A
    # one-way relocation (Category 2, where JIS X 0208-1983 gave the
    # unsimplified form a new code while the simplified form kept the
    # original code) would collide with the simplified form that keeps
    # that code, so the unsimplified form is treated as not in JIS C
    # 6226-1978.

    my $back = JIS78GL_by_JIS83GL($jis78gl);
    if ((not defined $back) or ($back ne $jis83gl)) {
        return q{};
    }
    return SJIS_by_JISGL($jis78gl);  # relocated (exchanged) in JIS C 6226-1978
}

# "sjis" of JIS X 0213:2000 by "sjis" of JIS X 0213:2004
sub SJIS2000_by_SJIS2004 {
    my($sjis2004) = @_;
    if (($sjis2004 eq q{}) or $SJIS_appended_by_2004{$sjis2004}) {
        return q{};
    }
    return $sjis2004;
}



( run in 0.705 second using v1.01-cache-2.11-cpan-84de2e75c66 )