Jcode.pm インストール
Jcode.pm とは
Jcode.pm とは様々な文字コードで記述されるデータを処理するためのモジュールです。例えば日本語で書かれるWebページはShift-JIS、JIS、EUC、UTF-8など様々なコードで記述されているのはご存じかと思います。その様なバラバラな文字コードをプログラム(Perl)で処理する際に文字コードをそろえる必要があります。その文字コードを判別し指定された文字コードに出力してくれるのが、この日本語文字コード用 汎用モジュール Jcode.pm です。
参照: http://openlab.ring.gr.jp/Jcode/index-j.html
Perlのバージョン確認
Jcode.pm はPerl5専用ですので、まずPerl5を使っていることを確認します。
# perl -v
This is perl, v5.8.5 built for i386-linux-thread-multiCopyright 1987-2004, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl’ or `perldoc perl’. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
Jcode.pm インストール
CPANよりインストールします。とっても簡単だし、バージョンもチェックしてくれますしね。
はじめてCPANモジュールを実行した場合は、いくつかの質問が表示されますので適切なモノをお答え下さい。
シェルよりCPANモジュールを起動します。
# perl -MCPAN -e shell
Terminal does not support AddHistory.cpan shell — CPAN exploration and modules installation (v1.7601)
ReadLine support available (try ‘install Bundle::CPAN’)cpan>
”install Jcode”を入力して、Jcode.pmのインストールを実行します
cpan> install Jcode
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Sat, 28 Jan 2006 21:13:10 GMT
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
ftp://ftp.dti.ad.jp/pub/lang/CPAN/authors/01mailrc.txt.gz
Going to read /root/.cpan/sources/authors/01mailrc.txt.gz
Fetching with LWP:
ftp://ftp.dti.ad.jp/pub/lang/CPAN/modules/02packages.details.txt.gz
Going to read /root/.cpan/sources/modules/02packages.details.txt.gz
Database was generated on Sat, 05 Aug 2006 02:31:41 GMTThere’s a new CPAN.pm version (v1.87) available!
[Current version is v1.7601]
You might want to try
install Bundle::CPAN
reload cpan
without quitting the current session. It should be a seamless upgrade
while we are running…Fetching with LWP:
ftp://ftp.dti.ad.jp/pub/lang/CPAN/modules/03modlist.data.gz
Going to read /root/.cpan/sources/modules/03modlist.data.gz
Going to write /root/.cpan/Metadata
Running install for module Jcode
Running make for D/DA/DANKOGAI/Jcode-2.06.tar.gz
Fetching with LWP:
ftp://ftp.dti.ad.jp/pub/lang/CPAN/authors/id/D/DA/DANKOGAI/Jcode-2.06.tar.gz
CPAN: Digest::MD5 loaded ok
Fetching with LWP:
ftp://ftp.dti.ad.jp/pub/lang/CPAN/authors/id/D/DA/DANKOGAI/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/D/DA/DANKOGAI/Jcode-2.06.tar.gz ok
Scanning cache /root/.cpan/build for sizes
Jcode-2.06/
Jcode-2.06/Changes
Jcode-2.06/Changes.ver0X
Jcode-2.06/Jcode/
Jcode-2.06/Jcode/_Classic.pm
Jcode-2.06/Jcode/Constants.pm
Jcode-2.06/Jcode/H2Z.pm
Jcode-2.06/Jcode/Nihongo.pod
Jcode-2.06/Jcode/Tr.pm
Jcode-2.06/Jcode/Unicode/
Jcode-2.06/Jcode/Unicode/Constants.pm
Jcode-2.06/Jcode/Unicode/NoXS.pm
Jcode-2.06/Jcode.pm
Jcode-2.06/Makefile.PL
Jcode-2.06/MANIFEST
Jcode-2.06/META.yml
Jcode-2.06/README
Jcode-2.06/t/
Jcode-2.06/t/_test_unicode.pl
Jcode-2.06/t/ambiguous.pl
Jcode-2.06/t/append.t
Jcode-2.06/t/benchmark.pl
Jcode-2.06/t/convert.t
Jcode-2.06/t/fun.pl
Jcode-2.06/t/getcode.t
Jcode-2.06/t/h2z.t
Jcode-2.06/t/hankaku.euc
Jcode-2.06/t/hiragana.euc
Jcode-2.06/t/._jfold.t
Jcode-2.06/t/jfold.t
Jcode-2.06/t/length.t
Jcode-2.06/t/mime.t
Jcode-2.06/t/new.t
Jcode-2.06/t/perl581.t
Jcode-2.06/t/._regex.t
Jcode-2.06/t/regex.t
Jcode-2.06/t/stripped.euc
Jcode-2.06/t/table.euc
Jcode-2.06/t/table.jis
Jcode-2.06/t/table.sjis
Jcode-2.06/t/table.ucs2
Jcode-2.06/t/table.utf8
Jcode-2.06/t/._tr.t
Jcode-2.06/t/tr.t
Jcode-2.06/t/unibench.pl
Jcode-2.06/t/x0212.euc
Jcode-2.06/t/x0212.jis
Jcode-2.06/t/x0212.ucs2
Jcode-2.06/t/x0212.utf8
Jcode-2.06/t/zenkaku.euc
Jcode-2.06/Unicode/
Jcode-2.06/Unicode/euc2uni.h
Jcode-2.06/Unicode/Makefile.PL
Jcode-2.06/Unicode/uni.c
Jcode-2.06/Unicode/uni2euc.h
Jcode-2.06/Unicode/Unicode.pm
Jcode-2.06/Unicode/Unicode.xsCPAN.pm: Going to build D/DA/DANKOGAI/Jcode-2.06.tar.gz
Checking if your kit is complete…
Looks good
Writing Makefile for Jcode
cp Jcode/Nihongo.pod blib/lib/Jcode/Nihongo.pod
cp Jcode.pm blib/lib/Jcode.pm
Manifying blib/man3/Jcode::Nihongo.3pm
Jcode/Nihongo.pod:1: Unknown command paragraph “=encoding euc-jp”
Manifying blib/man3/Jcode.3pm
/usr/bin/make — OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl “-MExtUtils::Command::MM” “-e” “test_harness(0, ‘blib/lib’, ‘blib/arch’)” t/*.t
t/append…..ok
t/convert….ok
t/getcode….ok
t/h2z……..ok
t/jfold……ok
t/length…..ok
t/mime…….ok
t/new……..ok
t/perl581….ok
t/regex……ok
t/tr………ok
All tests successful.
Files=11, Tests=244, 3 wallclock secs ( 2.13 cusr + 0.10 csys = 2.23 CPU)
/usr/bin/make test — OK
Running make install
Installing /usr/lib/perl5/site_perl/5.8.5/Jcode.pm
Writing /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Jcode/.packlist
Appending installation info to /usr/lib/perl5/5.8.5/i386-linux-thread-multi/perllocal.pod
/usr/bin/make install — OK
”exit”を入力して、CPANから抜けます
cpan> exit
Terminal does not support GetHistory.
Lockfile removed.
以上でした♥
参照: http://www.ring.gr.jp/pub/lang/perl/CPAN/
参照: http://openlab.ring.gr.jp/Jcode/index-j.html
- カテゴリ:Web開発
- 公開日:2006/08/05
- ↑ 記事評価をお願いします。
