OSDN Git Service

* Fix: Can't decode MIME encode JIS strings.
authorNARUSE, Yui <naruse@users.sourceforge.jp>
Sun, 28 Jan 2007 15:30:05 +0000 (15:30 +0000)
committerNARUSE, Yui <naruse@users.sourceforge.jp>
Sun, 28 Jan 2007 15:30:05 +0000 (15:30 +0000)
  http://pc10.2ch.net/test/read.cgi/unix/1005206241/189

nkf.c

diff --git a/nkf.c b/nkf.c
index b9f4755..d83ec9f 100644 (file)
--- a/nkf.c
+++ b/nkf.c
@@ -39,9 +39,9 @@
 **        E-Mail: furukawa@tcp-ip.or.jp
 **    \e$B$^$G8fO"Mm$r$*4j$$$7$^$9!#\e(B
 ***********************************************************************/
-/* $Id: nkf.c,v 1.119 2006/11/11 20:33:56 naruse Exp $ */
+/* $Id: nkf.c,v 1.120 2007/01/28 06:30:05 naruse Exp $ */
 #define NKF_VERSION "2.0.8"
-#define NKF_RELEASE_DATE "2006-11-12"
+#define NKF_RELEASE_DATE "2007-01-28"
 #include "config.h"
 #include "utf8tbl.h"
 
@@ -2733,13 +2733,13 @@ nkf_char kanji_convert(FILE *f)
                     /* normal ASCII code */ 
                     SEND;
                 }
-            } else if (!is_8bit && c1 == SI) {
+            } else if (c1 == SI && (!is_8bit || mime_decode_mode)) {\r
                 shift_mode = FALSE; 
                 NEXT;
-            } else if (!is_8bit && c1 == SO) {
+            } else if (c1 == SO && (!is_8bit || mime_decode_mode)) {\r
                 shift_mode = TRUE; 
                 NEXT;
-            } else if (!is_8bit && c1 == ESC ) {
+            } else if (c1 == ESC && (!is_8bit || mime_decode_mode)) {\r
                 if ((c1 = (*i_getc)(f)) == EOF) {
                     /*  (*oconv)(0, ESC); don't send bogus code */
                     LAST;