OSDN Git Service

Fix: can't convert CP50221's UDC to CP932
authorNARUSE, Yui <naruse@users.sourceforge.jp>
Thu, 13 Sep 2012 10:39:24 +0000 (19:39 +0900)
committerNARUSE, Yui <naruse@users.sourceforge.jp>
Thu, 13 Sep 2012 10:39:24 +0000 (19:39 +0900)
patched by TOMITA Masahiro. [nkf-forum:65482]

nkf.c
nkf_test.pl

diff --git a/nkf.c b/nkf.c
index 5209864..a16b142 100644 (file)
--- 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"
  * 3. This notice may not be removed or altered from any source distribution.
  */
 #define NKF_VERSION "2.1.3"
-#define NKF_RELEASE_DATE "2012-08-29"
+#define NKF_RELEASE_DATE "2012-09-13"
 #define COPY_RIGHT \
     "Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
     "Copyright (C) 1996-2012, The nkf Project."
 #define COPY_RIGHT \
     "Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
     "Copyright (C) 1996-2012, The nkf Project."
@@ -5491,7 +5491,7 @@ kanji_convert(FILE *f)
            code_status(c1);
        if (c2) {
            /* second byte */
            code_status(c1);
        if (c2) {
            /* second byte */
-           if (c2 > DEL) {
+           if (c2 > ((input_encoding && nkf_enc_cp5022x_p(input_encoding)) ? 0x92 : DEL)) {
                /* in case of 8th bit is on */
                if (!estab_f&&!mime_decode_mode) {
                    /* in case of not established yet */
                /* in case of 8th bit is on */
                if (!estab_f&&!mime_decode_mode) {
                    /* in case of not established yet */
index af607be..79cfea6 100644 (file)
@@ -1071,6 +1071,11 @@ printf "%-40s",  "[nkf-forum:65316]  ";
     "\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");
 
     "\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");
 
+printf "%-40s",  "[nkf-forum:65482]  ";
+    &test("$nkf --ic=CP50221 --oc=CP932",
+    "\x1b\x24\x42\x7f\x21\x80\x21\x1b\x28\x42\n",
+    "\xf0\x40\xf0\x9f\x0a");
+
     if (!NKF) {
 printf "%-40s", "Guess NL";
 &command_tests(
     if (!NKF) {
 printf "%-40s", "Guess NL";
 &command_tests(