OSDN Git Service

Release 2.1.2.
[nkf/nkf.git] / NKF.mod / NKF.pm
index e7c0069..0e5003b 100644 (file)
@@ -1,25 +1,24 @@
-## Copyright (C) 1996,1998
-## Copyright (C) 2002
-## Ï¢ÍíÀ衧 Î°µåÂç³Ø¾ðÊ󹩳زʠ²ÏÌî ¿¿¼£  mime/X0208 support
-## ¡ÊE-Mail Address: kono@ie.u-ryukyu.ac.jp¡Ë
-## Ï¢ÍíÀ衧 COW for DOS & Win16 & Win32 & OS/2
-## ¡ÊE-Mail Address: GHG00637@niftyserve.or.p¡Ë
-##    
-##    ¤³¤Î¥½¡¼¥¹¤Î¤¤¤«¤Ê¤ëÊ£¼Ì¡¤²þÊÑ¡¤½¤Àµ¤âµöÂú¤·¤Þ¤¹¡£¤¿¤À¤·¡¢
-##    ¤½¤ÎºÝ¤Ë¤Ï¡¢Ã¯¤¬¹×¸¥¤·¤¿¤ò¼¨¤¹¤³¤ÎÉôʬ¤ò»Ä¤¹¤³¤È¡£
-##    ºÆÇÛÉۤ仨»ï¤ÎÉÕÏ¿¤Ê¤É¤ÎÌ䤤¹ç¤ï¤»¤âɬÍפ¢¤ê¤Þ¤»¤ó¡£
-##    ±ÄÍøÍøÍѤâ¾åµ­¤ËÈ¿¤·¤Ê¤¤ÈϰϤǵö²Ä¤·¤Þ¤¹¡£
-##    ¥Ð¥¤¥Ê¥ê¤ÎÇÛÉۤκݤˤÏversion message¤òÊݸ¤¹¤ë¤³¤È¤ò¾ò·ï¤È¤·¤Þ¤¹¡£
-##    ¤³¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ¤ÏÆä˲¿¤ÎÊݾڤ⤷¤Ê¤¤¡¢°­¤·¤«¤é¤º¡£
-##    
-##    Everyone is permitted to do anything on this program
-##    including copying, modifying, improving, 
-##    as long as you don't try to pretend that you wrote it.
-##    i.e., the above copyright notice has to appear in all copies.  
-##    Binar y distribution requires original version messages.
-##    You don't have to ask before copying, redistribution or publishing.
-##    THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE.
-
+# Copyright (c) 1987, Fujitsu LTD. (Itaru ICHIKAWA).
+# Copyright (c) 1996-2010, The nkf Project.
+# All rights reserved.
+#
+# This software is provided 'as-is', without any express or implied
+# warranty. In no event will the authors be held liable for any damages
+# arising from the use of this software.
+#
+# Permission is granted to anyone to use this software for any purpose,
+# including commercial applications, and to alter it and redistribute it
+# freely, subject to the following restrictions:
+#
+# 1. The origin of this software must not be misrepresented; you must not
+# claim that you wrote the original software. If you use this software
+# in a product, an acknowledgment in the product documentation would be
+# appreciated but is not required.
+#
+# 2. Altered source versions must be plainly marked as such, and must not be
+# misrepresented as being the original software.
+#
+# 3. This notice may not be removed or altered from any source distribution.
 
 package NKF;
 
@@ -36,7 +35,7 @@ require DynaLoader;
 @EXPORT = qw(
        nkf     nkf_continue    inputcode
 );
-$VERSION = '2.05';
+$VERSION = '2.12';
 
 bootstrap NKF $VERSION;
 
@@ -46,30 +45,53 @@ bootstrap NKF $VERSION;
 
 1;
 __END__
-# Below is the stub of documentation for your module. You better edit it!
+
+#
+# =begin ¤«¤é =begin COMMAND ¤Þ¤Ç¤Ï Perl/NKF ¤Î¥É¥­¥å¥á¥ó¥È
+# =begin COMMAND ¤«¤é =end ¤Þ¤Ç¤Ï nkf ¥³¥Þ¥ó¥É¤Î¥É¥­¥å¥á¥ó¥È
+# 
 
 =head1 NAME
 
-NKF - Perl extension for Network Kanji Filter 
+=begin
+
+NKF - Perl extension for Network Kanji Filter
+
+=begin COMMAND
+
+nkf - Network Kanji Filter
+
+=end
 
 =head1 SYNOPSIS
 
+=begin
+
   use NKF;
   $output = nkf("-s",$input);
 
+=begin COMMAND
+
+nkf B<[-butjnesliohrTVvwWJESZxXFfmMBOcdILg]> B<[>I<file ...>B<]>
+
+=end
+
 =head1 DESCRIPTION
 
-This is a Perl Extension version of nkf (Netowrk Kanji Filter).
+=begin
+
+This is a Perl Extension version of nkf (Network Kanji Filter).
 It converts the last argument and return converted result. Conversion
 details are specified by flags before the last argument.
 
+=end
 
 B<Nkf> is a yet another kanji code converter among networks, hosts and terminals.
 It converts input kanji code to designated kanji code
-such as ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8 or UTF-16.
+such as ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8, UTF-16 or UTF-32.
 
 One of the most unique faculty of B<nkf> is the guess of the input kanji encodings.
-It currently recognizes ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8 and UTF-16.
+It currently recognizes ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8, UTF-16 and UTF-32.
 So users needn't set the input kanji code explicitly.
 
 By default, X0201 kana is converted into X0208 kana.
@@ -77,56 +99,77 @@ For X0201 kana, SO/SI, SSO and ESC-(-I methods are supported.
 For automatic code detection, nkf assumes no X0201 kana in Shift_JIS.
 To accept X0201 in Shift_JIS, use B<-X>, B<-x> or B<-S>.
 
-=head1 Flags
+=head1 OPTIONS
 
 =over
 
-=item B<-b -u>
-
-Output is buffered (DEFAULT), Output is unbuffered.
-
-=item B<-j -s -e -w -w16>
-
-Output code is ISO-2022-JP (7bit JIS), Shift_JIS, EUC-JP,
-UTF-8N, UTF-16BE.
-Without this option and compile option, ISO-2022-JP is assumed.
-
-=item B<-J -S -E -W -W16>
+=item B<-J -S -E -W -W16 -W32 -j -s -e -w -w16 -w32>
 
-Input assumption is JIS 7 bit, Shift_JIS, EUC-JP,
-UTF-8, UTF-16LE.
+Specify input and output encodings. Upper case is input.
+cf. --ic and --oc.
 
 =over
 
 =item B<-J>
 
-Assume  JIS input. It also accepts EUC-JP.
-This is the default. This flag does not exclude Shift_JIS.
+ISO-2022-JP (JIS code).
 
 =item B<-S>
 
-Assume Shift_JIS and X0201 kana input. It also accepts JIS.
+Shift_JIS and JIS X 0201 kana.
 EUC-JP is recognized as X0201 kana. Without B<-x> flag,
-X0201 kana (halfwidth kana) is converted into X0208.
+JIS X 0201 Katakana (a.k.a.halfwidth kana) is converted into JIS X 0208.
+If you use Windows, see Windows-31J (CP932).
 
 =item B<-E>
 
-Assume EUC-JP input. It also accepts JIS.
-Same as -J.
+EUC-JP.
+
+=item B<-W>
+
+UTF-8N.
+
+=item B<-W16[BL][0]>
+
+UTF-16.
+B or L gives whether Big Endian or Little Endian.
+0 gives whther put BOM or not.
+
+=item B<-W32[BL][0]>
+
+UTF-32.
+B or L gives whether Big Endian or Little Endian.
+0 gives whther put BOM or not.
 
 =back
 
+=item B<-b -u>
+
+Output is buffered (DEFAULT), Output is unbuffered.
+
 =item B<-t>
 
 No conversion.
 
-=item B<-i_>
+=item B<-i[@B]>
+
+Specify the escape sequence for JIS X 0208.
+
+=over
+
+=item B<-i@>
+
+Use ESC ( @. (JIS X 0208-1978)
+
+=item B<-iB>
 
-Output sequence to designate JIS-kanji. (DEFAULT B)
+Use ESC ( B. (JIS X 0208-1983/1990 DEFAULT)
 
-=item B<-o_>
+=back
+
+=item B<-o[BJ]>
 
-Output sequence to designate ASCII. (DEFAULT B)
+Specify the escape sequence for US-ASCII/JIS X 0201 Roman. (DEFAULT B)
 
 =item B<-r>
 
@@ -154,10 +197,6 @@ Katakana to Hiragana and Hiragana to Katakana conversion.
 
 Text mode output (MS-DOS)
 
-=item B<-l>
-
-ISO8859-1 (Latin-1) support
-
 =item B<-f[I<m> [- I<n>]]>
 
 Folding on I<m> length with I<n> margin in a line.
@@ -179,24 +218,23 @@ Convert X0208 alphabet to ASCII.
 
 =item B<-Z1>
 
-Converts X0208 kankaku to single ASCII space.
+Convert X0208 kankaku to single ASCII space.
 
 =item B<-Z2>
 
-Converts X0208 kankaku to double ASCII spaces.
+Convert X0208 kankaku to double ASCII spaces.
 
 =item B<-Z3>
 
-Replacing Fullwidth >, <, ", & into '&gt;', '&lt;', '&quot;', '&amp;' as in HTML.
+Replacing fullwidth >, <, ", & into '&gt;', '&lt;', '&quot;', '&amp;' as in HTML.
 
 =back
 
 =item B<-X -x>
 
-Assume X0201 kana in MS-Kanji.
 With B<-X> or without this option, X0201 is converted into X0208 Kana.
 With B<-x>, try to preserve X0208 kana and do not convert X0201 kana to X0208.
-In JIS output, ESC-(-I is used. In EUC output, SSO is used.
+In JIS output, ESC-(-I is used. In EUC output, SS2 is used.
 
 =item B<-B[0-2]>
 
@@ -207,11 +245,11 @@ Useful when your site is using old B-News Nihongo patch.
 
 =item B<-B1>
 
-allows any char after ESC-( or ESC-$.
+allows any chars after ESC-( or ESC-$.
 
 =item B<-B2>
 
-forces ASCII after NL.
+force ASCII after NL.
 
 =back
 
@@ -220,10 +258,6 @@ forces ASCII after NL.
 Replacing non iso-2022-jp char into a geta character
 (substitute character in Japanese).
 
-=item B<-d -c>
-
-Delete \r in line feed, Add \r in line feed.
-
 =item B<-m[BQN0]>
 
 MIME ISO-2022-JP/ISO8859-1 decode. (DEFAULT)
@@ -264,7 +298,7 @@ Kanji conversion is performed before encoding, so this cannot be used as a pictu
 
 =item B<-MQ>
 
-Perfome quoted encoding.
+Perform quoted encoding.
 
 =back
 
@@ -273,17 +307,17 @@ Perfome quoted encoding.
 Input and output code is ISO8859-1 (Latin-1) and ISO-2022-JP.
 B<-s>, B<-e> and B<-x> are not compatible with this option.
 
-=item B<-L[uwm]>
+=item B<-L[uwm] -d -c>
 
-new line mode
+Convert line breaks.
 
 =over
 
-=item B<-Lu>
+=item B<-Lu -d>
 
 unix (LF)
 
-=item B<-Lw>
+=item B<-Lw -c>
 
 windows (CRLF)
 
@@ -297,20 +331,20 @@ Without this option, nkf doesn't convert line breaks.
 
 =item B<--fj --unix --mac --msdos --windows>
 
-convert for these system
+Convert for these systems.
 
 =item B<--jis --euc --sjis --mime --base64>
 
-convert for named code
+Convert to named code.
 
 =item B<--jis-input --euc-input --sjis-input --mime-input --base64-input>
 
-assume input system
+Assume input system
 
 =item B<--ic=I<input codeset> --oc=I<output codeset>>
 
 Set the input or output codeset.
-NKF supports following codesets and those codeset name are case insensitive.
+NKF supports following codesets and those codeset names are case insensitive.
 
 =over
 
@@ -332,11 +366,11 @@ Microsoft Version of EUC-JP.
 
 =item Shift_JIS
 
-a.k.a. SJIS, MS-Kanji
+a.k.a. SJIS, MS_Kanji
 
-=item CP932
+=item Windows-31J
 
-a.k.a. Windows-31J
+a.k.a. CP932
 
 =item UTF-8
 
@@ -350,6 +384,10 @@ UTF-8 without BOM
 
 UTF-8 with BOM
 
+=item UTF8-MAC (input only)
+
+decomposed UTF-8
+
 =item UTF-16
 
 same as UTF-16BE
@@ -370,7 +408,25 @@ UTF-16 Little Endian without BOM
 
 UTF-16 Little Endian with BOM
 
-=item UTF8-MAC (input only)
+=item UTF-32
+
+same as UTF-32BE
+
+=item UTF-32BE
+
+UTF-32 Big Endian without BOM
+
+=item UTF-32BE-BOM
+
+UTF-32 Big Endian with BOM
+
+=item UTF-32LE
+
+UTF-32 Little Endian without BOM
+
+=item UTF-32LE-BOM
+
+UTF-32 Little Endian with BOM
 
 =back
 
@@ -397,7 +453,7 @@ When Unicode to Unicode conversion,
 with this and -x option, nkf can be used as UTF converter.
 (In other words, without this and -x option, nkf doesn't save some characters)
 
-When nkf convert string which related to path, you should use this opion.
+When nkf converts strings that related to path, you should use this opion.
 
 =item B<--cap-input>
 
@@ -411,6 +467,28 @@ Unescape percent escaped characters.
 
 Decode character reference, such as "&#....;".
 
+=begin COMMAND
+
+=item B<--in-place[=>I<SUFFIX>B<]>  B<--overwrite[=>I<SUFFIX>B<]>
+
+Overwrite B<original> listed files by filtered result.
+
+B<Note> --overwrite preserves timestamps of original files.
+
+=item B<--guess=[12]>
+
+Print guessed encoding and newline. (2 is default, 1 is only encoding)
+
+=item B<--help>
+
+Print nkf's help.
+
+=item B<--version>
+
+Print nkf's version.
+
+=end
+
 =item B<-->
 
 Ignore rest of -option.
@@ -419,12 +497,16 @@ Ignore rest of -option.
 
 =head1 AUTHOR
 
-Network Kanji Filter Version 2.0.5
+Copyright (c) 1987, Fujitsu LTD. (Itaru ICHIKAWA).
 
-Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa),2000 S. Kono, COW, 2002-2005 Kono, Furukawa, Naruse
+Copyright (c) 1996-2010, The nkf Project.
+
+=begin
 
 =head1 SEE ALSO
 
 perl(1).   nkf(1)
 
+=end
+
 =cut