Index: /trunk/dports/textproc/nkf/Portfile
===================================================================
--- /trunk/dports/textproc/nkf/Portfile	(revision 97687)
+++ /trunk/dports/textproc/nkf/Portfile	(revision 97688)
@@ -5,5 +5,6 @@
 
 name            nkf
-version         2.1.2
+version         2.1.3
+set distversion 2.1.2
 categories      textproc japanese
 maintainers     takanori openmaintainer
@@ -17,6 +18,12 @@
 homepage        http://sourceforge.jp/projects/nkf/
 master_sites    sourceforge_jp:${name}/53171/
-patchfiles      nkf.git-ecf2a983ff0945462d731afa9b4d7327cfeb9b5a.patch
+patchfiles      nkf.git-ecf2a983ff0945462d731afa9b4d7327cfeb9b5a.patch \
+                nkf.git-4e632c30b502e56032a1781e4edf44ec462fe6ad.patch \
+                nkf.git-832e032be763ec6acf1cf13225b0d72f1b867a18.patch \
+                nkf.git-6bbe38e718c98825229bce7ef9f8d236e63c095f.patch \
+                nkf.git-fcc185d621977d87cc50c1561be0aff3924af2ac.patch
 checksums       rmd160  91c0d413a70299246591d314d33f45e71eba51a7
+
+distname        ${name}-${distversion}
 
 patch.pre_args  -p1
@@ -50,3 +57,4 @@
 livecheck.type  regex
 livecheck.url   ${homepage}files/
+livecheck.version   ${distversion}
 livecheck.regex ${name}-(\[0-9.a-z\]+)\\.tar
Index: /trunk/dports/textproc/nkf/files/nkf.git-4e632c30b502e56032a1781e4edf44ec462fe6ad.patch
===================================================================
--- /trunk/dports/textproc/nkf/files/nkf.git-4e632c30b502e56032a1781e4edf44ec462fe6ad.patch	(revision 97688)
+++ /trunk/dports/textproc/nkf/files/nkf.git-4e632c30b502e56032a1781e4edf44ec462fe6ad.patch	(revision 97688)
@@ -0,0 +1,28 @@
+From: NARUSE, Yui <naruse@users.sourceforge.jp>
+Date: Sat, 17 Mar 2012 11:40:54 +0000 (+0900)
+Subject: Show endian on --guess.
+X-Git-Url: http://git.sourceforge.jp/view?p=nkf%2Fnkf.git;a=commitdiff_plain;h=4e632c30b502e56032a1781e4edf44ec462fe6ad
+
+Show endian on --guess.
+
+http://sourceforge.jp/ticket/browse.php?group_id=248&tid=26325
+---
+
+diff --git a/nkf.c b/nkf.c
+index 0382f30..b9df10e 100644
+--- a/nkf.c
++++ b/nkf.c
+@@ -4190,8 +4190,12 @@ print_guessed_code(char *filename)
+ 	if (guess_f == 1) {
+ 	    printf("%s\n", input_codename);
+ 	} else {
+-	    printf("%s%s\n",
++	    printf("%s%s%s\n",
+ 		   input_codename,
++		   iconv != w_iconv16 && iconv != w_iconv32 ? "" :
++		   input_endian == ENDIAN_LITTLE ? " LE" :
++		   input_endian == ENDIAN_BIG ? " BE" :
++		   "[BUG]",
+ 		   input_eol == CR   ? " (CR)" :
+ 		   input_eol == LF   ? " (LF)" :
+ 		   input_eol == CRLF ? " (CRLF)" :
Index: /trunk/dports/textproc/nkf/files/nkf.git-6bbe38e718c98825229bce7ef9f8d236e63c095f.patch
===================================================================
--- /trunk/dports/textproc/nkf/files/nkf.git-6bbe38e718c98825229bce7ef9f8d236e63c095f.patch	(revision 97688)
+++ /trunk/dports/textproc/nkf/files/nkf.git-6bbe38e718c98825229bce7ef9f8d236e63c095f.patch	(revision 97688)
@@ -0,0 +1,37 @@
+From: NARUSE, Yui <naruse@users.sourceforge.jp>
+Date: Wed, 29 Aug 2012 05:45:10 +0000 (+0900)
+Subject: Fix: Halfwidh treated as fullwidth on folding. [nkf-forum:65316]
+X-Git-Url: http://git.sourceforge.jp/view?p=nkf%2Fnkf.git;a=commitdiff_plain;h=6bbe38e718c98825229bce7ef9f8d236e63c095f
+
+Fix: Halfwidh treated as fullwidth on folding. [nkf-forum:65316]
+---
+
+diff --git a/nkf.c b/nkf.c
+index ee855d8..4a6d758 100644
+--- a/nkf.c
++++ b/nkf.c
+@@ -3500,7 +3500,7 @@ fold_conv(nkf_char c2, nkf_char c1)
+ 	f_prev = c1;
+ 	if (c2 || c2 == JIS_X_0201_1976_K)
+ 	    f_prev |= 0x80;  /* this is Japanese */
+-	f_line += char_size(c2,c1);
++	f_line += c2 == JIS_X_0201_1976_K ? 1: char_size(c2,c1);
+ 	if (f_line<=fold_len) {   /* normal case */
+ 	    fold_state = 1;
+ 	} else {
+diff --git a/nkf_test.pl b/nkf_test.pl
+index 9f85675..af607be 100644
+--- a/nkf_test.pl
++++ b/nkf_test.pl
+@@ -1066,6 +1066,11 @@ printf "%-40s",  "[nkf-bug:21393]-X  ";
+     "\xEF\xBD\xBC\xEF\xBE\x9E\xEF\xBD\xAC\xEF\xBD\xB0\xEF\xBE\x8F\xEF\xBE\x9D\xEF\xBD\xA5\xEF\xBE\x8E\xEF\xBE\x9F\xEF\xBE\x83\xEF\xBE\x84\xEF\xBD\xA1",
+     "\x83W\x83\x83\x81[\x83}\x83\x93\x81E\x83|\x83e\x83g\x81B");
+ 
++printf "%-40s",  "[nkf-forum:65316]  ";
++    &test("$nkf -xwW -f10",
++    "\xEF\xBD\xB1\xEF\xBD\xB2\xEF\xBD\xB3\xEF\xBD\xB4\xEF\xBD\xB5\xEF\xBD\xB6\xEF\xBD\xB7\xEF\xBD\xB8\xEF\xBD\xB9\xEF\xBD\xBA\xEF\xBD\xBB\xEF\xBD\xBC\xEF\xBD\xBD\xEF\xBD\xBE\xEF\xBD\xBF\xEF\xBE\x80\xEF\xBE\x81\xEF\xBE\x82\xEF\xBE\x83\xEF\xBE\x84",
++    "\xEF\xBD\xB1\xEF\xBD\xB2\xEF\xBD\xB3\xEF\xBD\xB4\xEF\xBD\xB5\xEF\xBD\xB6\xEF\xBD\xB7\xEF\xBD\xB8\xEF\xBD\xB9\xEF\xBD\xBA\n\xEF\xBD\xBB\xEF\xBD\xBC\xEF\xBD\xBD\xEF\xBD\xBE\xEF\xBD\xBF\xEF\xBE\x80\xEF\xBE\x81\xEF\xBE\x82\xEF\xBE\x83\xEF\xBE\x84\n");
++
+     if (!NKF) {
+ printf "%-40s", "Guess NL";
+ &command_tests(
Index: /trunk/dports/textproc/nkf/files/nkf.git-832e032be763ec6acf1cf13225b0d72f1b867a18.patch
===================================================================
--- /trunk/dports/textproc/nkf/files/nkf.git-832e032be763ec6acf1cf13225b0d72f1b867a18.patch	(revision 97688)
+++ /trunk/dports/textproc/nkf/files/nkf.git-832e032be763ec6acf1cf13225b0d72f1b867a18.patch	(revision 97688)
@@ -0,0 +1,92 @@
+From: NARUSE, Yui <naruse@users.sourceforge.jp>
+Date: Sat, 17 Mar 2012 11:50:17 +0000 (+0900)
+Subject: Show "(BOM)" if the byte sequence has BOM.
+X-Git-Url: http://git.sourceforge.jp/view?p=nkf%2Fnkf.git;a=commitdiff_plain;h=832e032be763ec6acf1cf13225b0d72f1b867a18
+
+Show "(BOM)" if the byte sequence has BOM.
+
+http://sourceforge.jp/ticket/browse.php?group_id=248&tid=26325
+---
+
+diff --git a/nkf.c b/nkf.c
+index b9df10e..ee855d8 100644
+--- a/nkf.c
++++ b/nkf.c
+@@ -20,11 +20,11 @@
+  *
+  * 3. This notice may not be removed or altered from any source distribution.
+  */
+-#define NKF_VERSION "2.1.2"
+-#define NKF_RELEASE_DATE "2011-09-08"
++#define NKF_VERSION "2.1.3"
++#define NKF_RELEASE_DATE "2012-03-17"
+ #define COPY_RIGHT \
+     "Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
+-    "Copyright (C) 1996-2011, The nkf Project."
++    "Copyright (C) 1996-2012, The nkf Project."
+ 
+ #include "config.h"
+ #include "nkf.h"
+@@ -356,6 +356,7 @@ static  int     no_cp932ext_f = FALSE;
+ /* ignore ZERO WIDTH NO-BREAK SPACE */
+ static  int     no_best_fit_chars_f = FALSE;
+ static  int     input_endian = ENDIAN_BIG;
++static  int     input_bom_f = FALSE;
+ static  nkf_char     unicode_subchar = '?'; /* the regular substitution character */
+ static  void    (*encode_fallback)(nkf_char c) = NULL;
+ static  void    w_status(struct input_code *, nkf_char);
+@@ -3202,6 +3203,7 @@ check_bom(FILE *f)
+ 			set_iconv(TRUE, w_iconv32);
+ 		    }
+ 		    if (iconv == w_iconv32) {
++			input_bom_f = TRUE;
+ 			input_endian = ENDIAN_BIG;
+ 			return;
+ 		    }
+@@ -3232,6 +3234,7 @@ check_bom(FILE *f)
+ 		    set_iconv(TRUE, w_iconv);
+ 		}
+ 		if (iconv == w_iconv) {
++		    input_bom_f = TRUE;
+ 		    return;
+ 		}
+ 		(*i_ungetc)(0xBF,f);
+@@ -3260,6 +3263,7 @@ check_bom(FILE *f)
+ 	    }
+ 	    if (iconv == w_iconv16) {
+ 		input_endian = ENDIAN_BIG;
++		input_bom_f = TRUE;
+ 		return;
+ 	    }
+ 	    (*i_ungetc)(0xFF,f);
+@@ -3275,6 +3279,7 @@ check_bom(FILE *f)
+ 		    }
+ 		    if (iconv == w_iconv32) {
+ 			input_endian = ENDIAN_LITTLE;
++			input_bom_f = TRUE;
+ 			return;
+ 		    }
+ 		    (*i_ungetc)(0x00,f);
+@@ -3286,6 +3291,7 @@ check_bom(FILE *f)
+ 	    }
+ 	    if (iconv == w_iconv16) {
+ 		input_endian = ENDIAN_LITTLE;
++		input_bom_f = TRUE;
+ 		return;
+ 	    }
+ 	    (*i_ungetc)(0xFE,f);
+@@ -4190,12 +4196,13 @@ print_guessed_code(char *filename)
+ 	if (guess_f == 1) {
+ 	    printf("%s\n", input_codename);
+ 	} else {
+-	    printf("%s%s%s\n",
++	    printf("%s%s%s%s\n",
+ 		   input_codename,
+ 		   iconv != w_iconv16 && iconv != w_iconv32 ? "" :
+ 		   input_endian == ENDIAN_LITTLE ? " LE" :
+ 		   input_endian == ENDIAN_BIG ? " BE" :
+ 		   "[BUG]",
++		   input_bom_f ? " (BOM)" : "",
+ 		   input_eol == CR   ? " (CR)" :
+ 		   input_eol == LF   ? " (LF)" :
+ 		   input_eol == CRLF ? " (CRLF)" :
Index: /trunk/dports/textproc/nkf/files/nkf.git-fcc185d621977d87cc50c1561be0aff3924af2ac.patch
===================================================================
--- /trunk/dports/textproc/nkf/files/nkf.git-fcc185d621977d87cc50c1561be0aff3924af2ac.patch	(revision 97688)
+++ /trunk/dports/textproc/nkf/files/nkf.git-fcc185d621977d87cc50c1561be0aff3924af2ac.patch	(revision 97688)
@@ -0,0 +1,21 @@
+From: NARUSE, Yui <naruse@users.sourceforge.jp>
+Date: Wed, 29 Aug 2012 11:47:57 +0000 (+0900)
+Subject: update release date.
+X-Git-Url: http://git.sourceforge.jp/view?p=nkf%2Fnkf.git;a=commitdiff_plain;h=fcc185d621977d87cc50c1561be0aff3924af2ac
+
+update release date.
+---
+
+diff --git a/nkf.c b/nkf.c
+index 4a6d758..5209864 100644
+--- a/nkf.c
++++ b/nkf.c
+@@ -21,7 +21,7 @@
+  * 3. This notice may not be removed or altered from any source distribution.
+  */
+ #define NKF_VERSION "2.1.3"
+-#define NKF_RELEASE_DATE "2012-03-17"
++#define NKF_RELEASE_DATE "2012-08-29"
+ #define COPY_RIGHT \
+     "Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
+     "Copyright (C) 1996-2012, The nkf Project."
