diff options
author | ayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-07 17:56:24 +0000 |
---|---|---|
committer | ayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-07 17:56:24 +0000 |
commit | 9f4dd65e890a465c40d71f97df38e117f28d7bed (patch) | |
tree | 7a3dd96736365e8768b70dc51e9cc99a40c7a52a /ext/nkf/nkf-utf8/nkf.c | |
parent | 7b30cb6122f2e4d2b2461c49ea67c294f4aff5e6 (diff) | |
download | ruby-9f4dd65e890a465c40d71f97df38e117f28d7bed.tar.gz |
Change encoding from ISO-2022 to UTF-8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/nkf/nkf-utf8/nkf.c')
-rw-r--r-- | ext/nkf/nkf-utf8/nkf.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/ext/nkf/nkf-utf8/nkf.c b/ext/nkf/nkf-utf8/nkf.c index fc5b30d921..47dcf77dca 100644 --- a/ext/nkf/nkf-utf8/nkf.c +++ b/ext/nkf/nkf-utf8/nkf.c @@ -3503,11 +3503,11 @@ fold_conv(nkf_char c2, nkf_char c1) fold_state = LF; /* We can't wait, do fold now */ } else if (c2 == JIS_X_0201_1976_K) { /* simple kinsoku rules return 1 means no folding */ - if (c1==(0xde&0x7f)) fold_state = 1; /* $B!+(B*/ - else if (c1==(0xdf&0x7f)) fold_state = 1; /* $B!,(B*/ - else if (c1==(0xa4&0x7f)) fold_state = 1; /* $B!#(B*/ - else if (c1==(0xa3&0x7f)) fold_state = 1; /* $B!$(B*/ - else if (c1==(0xa1&0x7f)) fold_state = 1; /* $B!W(B*/ + if (c1==(0xde&0x7f)) fold_state = 1; /* ゛*/ + else if (c1==(0xdf&0x7f)) fold_state = 1; /* ゜*/ + else if (c1==(0xa4&0x7f)) fold_state = 1; /* 。*/ + else if (c1==(0xa3&0x7f)) fold_state = 1; /* ,*/ + else if (c1==(0xa1&0x7f)) fold_state = 1; /* 」*/ else if (c1==(0xb0&0x7f)) fold_state = 1; /* - */ else if (SP<=c1 && c1<=(0xdf&0x7f)) { /* X0201 */ f_line = 1; @@ -3543,18 +3543,18 @@ fold_conv(nkf_char c2, nkf_char c1) } } else { if (c2=='!') { - if (c1=='"') fold_state = 1; /* $B!"(B */ - else if (c1=='#') fold_state = 1; /* $B!#(B */ - else if (c1=='W') fold_state = 1; /* $B!W(B */ - else if (c1=='K') fold_state = 1; /* $B!K(B */ - else if (c1=='$') fold_state = 1; /* $B!$(B */ - else if (c1=='%') fold_state = 1; /* $B!%(B */ - else if (c1=='\'') fold_state = 1; /* $B!\(B */ - else if (c1=='(') fold_state = 1; /* $B!((B */ - else if (c1==')') fold_state = 1; /* $B!)(B */ - else if (c1=='*') fold_state = 1; /* $B!*(B */ - else if (c1=='+') fold_state = 1; /* $B!+(B */ - else if (c1==',') fold_state = 1; /* $B!,(B */ + if (c1=='"') fold_state = 1; /* 、 */ + else if (c1=='#') fold_state = 1; /* 。 */ + else if (c1=='W') fold_state = 1; /* 」 */ + else if (c1=='K') fold_state = 1; /* ) */ + else if (c1=='$') fold_state = 1; /* , */ + else if (c1=='%') fold_state = 1; /* . */ + else if (c1=='\'') fold_state = 1; /* + */ + else if (c1=='(') fold_state = 1; /* ; */ + else if (c1==')') fold_state = 1; /* ? */ + else if (c1=='*') fold_state = 1; /* ! */ + else if (c1=='+') fold_state = 1; /* ゛ */ + else if (c1==',') fold_state = 1; /* ゜ */ /* default no fold in kinsoku */ else { fold_state = LF; @@ -3605,11 +3605,11 @@ z_conv(nkf_char c2, nkf_char c1) if (x0201_f) { if (z_prev2 == JIS_X_0201_1976_K) { if (c2 == JIS_X_0201_1976_K) { - if (c1 == (0xde&0x7f)) { /* $BByE@(B */ + if (c1 == (0xde&0x7f)) { /* 濁点 */ z_prev2 = 0; (*o_zconv)(dv[(z_prev1-SP)*2], dv[(z_prev1-SP)*2+1]); return; - } else if (c1 == (0xdf&0x7f) && ev[(z_prev1-SP)*2]) { /* $BH>ByE@(B */ + } else if (c1 == (0xdf&0x7f) && ev[(z_prev1-SP)*2]) { /* 半濁点 */ z_prev2 = 0; (*o_zconv)(ev[(z_prev1-SP)*2], ev[(z_prev1-SP)*2+1]); return; @@ -3620,7 +3620,7 @@ z_conv(nkf_char c2, nkf_char c1) } if (c2 == JIS_X_0201_1976_K) { if (dv[(c1-SP)*2] || ev[(c1-SP)*2]) { - /* wait for $BByE@(B or $BH>ByE@(B */ + /* wait for 濁点 or 半濁点 */ z_prev1 = c1; z_prev2 = c2; return; @@ -3876,7 +3876,7 @@ static const unsigned char *mime_pattern[] = { }; -/* $B3:Ev$9$k%3!<%I$NM%@hEY$r>e$2$k$?$a$NL\0u(B */ +/* 該当するコードの優先度を上げるための目印 */ nkf_char (*mime_priority_func[])(nkf_char c2, nkf_char c1, nkf_char c0) = { e_iconv, s_iconv, 0, 0, 0, 0, 0, #if defined(UTF8_INPUT_ENABLE) @@ -6652,12 +6652,12 @@ main(int argc, char **argv) if (stat(origfname, &sb)) { fprintf(stderr, "Can't stat %s\n", origfname); } - /* $B%Q!<%_%C%7%g%s$rI|85(B */ + /* パーミッションを復元 */ if (chmod(outfname, sb.st_mode)) { fprintf(stderr, "Can't set permission %s\n", outfname); } - /* $B%?%$%`%9%?%s%W$rI|85(B */ + /* タイムスタンプを復元 */ if(preserve_time_f){ #if defined(MSDOS) && !defined(__MINGW32__) && !defined(__WIN32__) && !defined(__WATCOMC__) && !defined(__EMX__) && !defined(__OS2__) && !defined(__DJGPP__) tb[0] = tb[1] = sb.st_mtime; |