Newsgroups: fj.lang.perl
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!news.iij.ad.jp!iijnet!news1!utashiro
From: utashiro@wide.ad.jp (Kazumasa Utashiro)
Subject: Re: Qestion: Kanji Matching(summary with Script)
In-Reply-To: hiroyuki@human.waseda.ac.jp's message of 12 Jul 1995 06:22:20 GMT
X-Nntp-Posting-Host: koedo.iij.ad.jp
Message-ID: <UTASHIRO.95Jul12174712@koedo.wide.ad.jp>
Sender: news@iij.ad.jp
Organization: WIDE Project
References: <hiroyuki-1107951731570001@524mac5.human.waseda.ac.jp>
	<hiroyuki-1207951526100001@524mac5.human.waseda.ac.jp>
Date: Wed, 12 Jul 1995 08:47:12 GMT
Lines: 29
Xref: galaxy.trc.rwcp.or.jp fj.lang.perl:425
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.lang.perl&nb=425&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

In article <hiroyuki-1207951526100001@524mac5.human.waseda.ac.jp> hiroyuki@human.waseda.ac.jp (Hiroyuki Konishi) writes:

   sub JIS2SJIS
   {
       local($jis, $sjis) = @_;

       open(TMP, "> $tmpFile");
       print TMP $jis;
       close(TMP);

       open(NKF, "$nkf -js $tmpFile |");
       $sjis = <NKF>;
       close(NKF);

       unlink($tmpFile);
       $sjis;
   }

$B%F%s%]%i%j%U%!%$%k$r:n$k$3$H$b$J$$$G$7$g$&!#(B

sub JIS2SJIS
{
    local(*NKF);

    open(NKF, "|$nkf -s") && print NKF @_;
    <NKF>;
}

--utashiro
