summaryrefslogtreecommitdiff
path: root/ext/nkf/nkf-utf8
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-03 19:04:29 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-03 19:04:29 +0000
commit9526ba4ef3a2dadebac9f7e364ab2180eabe10aa (patch)
tree3708d0cbdddf26e94c5f926300adb2d8b9aa058e /ext/nkf/nkf-utf8
parent8517275f82f91e89c7f31a79969c5d7194836265 (diff)
* ext/nkf/nkf-utf8/nkf.c: Update nkf 2010-04-28.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/nkf-utf8')
-rw-r--r--ext/nkf/nkf-utf8/nkf.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/nkf/nkf-utf8/nkf.c b/ext/nkf/nkf-utf8/nkf.c
index bdb2a4d7..ec10c83 100644
--- a/ext/nkf/nkf-utf8/nkf.c
+++ b/ext/nkf/nkf-utf8/nkf.c
@@ -21,7 +21,7 @@
* 3. This notice may not be removed or altered from any source distribution.
*/
#define NKF_VERSION "2.1.1"
-#define NKF_RELEASE_DATE "2010-04-14"
+#define NKF_RELEASE_DATE "2010-04-28"
#define COPY_RIGHT \
"Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
"Copyright (C) 1996-2010, The nkf Project."
@@ -223,6 +223,7 @@ struct {
{"ISO-2022-JP-2004", ISO_2022_JP_2004},
{"SHIFT_JIS", SHIFT_JIS},
{"SJIS", SHIFT_JIS},
+ {"MS_Kanji", SHIFT_JIS},
{"PCK", SHIFT_JIS},
{"WINDOWS-31J", WINDOWS_31J},
{"CSWINDOWS31J", WINDOWS_31J},
@@ -820,7 +821,7 @@ nkf_buf_new(int length)
buf->capa = length;
buf->len = 0;
return buf;
-}
+}
#if 0
static void
@@ -901,7 +902,7 @@ usage(void)
" Z[0-4] Default/0: Convert JISX0208 Alphabet to ASCII\n"
" 1: Kankaku to one space 2: to two spaces 3: HTML Entity\n"
" 4: JISX0208 Katakana to JISX0201 Katakana\n"
- " X,x Assume X0201 kana in MS-Kanji, -x preserves X0201\n"
+ " X,x Convert Halfwidth Katakana to Fullwidth or preserve it\n"
);
fprintf(HELP_OUTPUT,
" O Output to File (DEFAULT 'nkf.out')\n"
@@ -1208,10 +1209,10 @@ set_input_encoding(nkf_encoding *enc)
case ISO_8859_1:
iso8859_f = TRUE;
break;
- case CP50220:
case CP50221:
case CP50222:
if (x0201_f == NKF_UNSPECIFIED) x0201_f = FALSE; /* -x specified implicitly */
+ case CP50220:
#ifdef SHIFTJIS_CP932
cp51932_f = TRUE;
#endif
@@ -1264,6 +1265,7 @@ set_input_encoding(nkf_encoding *enc)
#endif
break;
case EUCJP_MS:
+ if (x0201_f == NKF_UNSPECIFIED) x0201_f = FALSE; /* -x specified implicitly */
#ifdef SHIFTJIS_CP932
cp51932_f = FALSE;
#endif
@@ -1272,6 +1274,7 @@ set_input_encoding(nkf_encoding *enc)
#endif
break;
case EUCJP_ASCII:
+ if (x0201_f == NKF_UNSPECIFIED) x0201_f = FALSE; /* -x specified implicitly */
#ifdef SHIFTJIS_CP932
cp51932_f = FALSE;
#endif
@@ -1326,7 +1329,6 @@ set_output_encoding(nkf_encoding *enc)
{
switch (nkf_enc_to_index(enc)) {
case CP50220:
- if (x0201_f == NKF_UNSPECIFIED) x0201_f = FALSE; /* -x specified implicitly */
#ifdef SHIFTJIS_CP932
if (cp932inv_f == TRUE) cp932inv_f = FALSE;
#endif
@@ -1402,12 +1404,14 @@ set_output_encoding(nkf_encoding *enc)
#endif
break;
case EUCJP_MS:
+ if (x0201_f == NKF_UNSPECIFIED) x0201_f = FALSE; /* -x specified implicitly */
x0212_f = TRUE;
#ifdef UTF8_OUTPUT_ENABLE
ms_ucs_map_f = UCS_MAP_MS;
#endif
break;
case EUCJP_ASCII:
+ if (x0201_f == NKF_UNSPECIFIED) x0201_f = FALSE; /* -x specified implicitly */
x0212_f = TRUE;
#ifdef UTF8_OUTPUT_ENABLE
ms_ucs_map_f = UCS_MAP_ASCII;
@@ -5870,7 +5874,7 @@ finished:
/*
* int options(unsigned char *cp)
- *
+ *
* return values:
* 0: success
* -1: ArgumentError