summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/nkf/nkf-utf8/nkf.c46
2 files changed, 28 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index e95ca3118a..ec5e4b0cf7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 8 02:53:00 2011 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
+
+ * lib/rexml/parsers/baseparser.rb, test/rexml/test_comment.rb:
+ Change encoding from ISO-2022 to UTF-8
+
Wed Sep 7 23:41:24 2011 Kouhei Sutou <kou@cozmixng.org>
* lib/rexml/parsers/baseparser.rb, test/rexml/test_comment.rb:
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;