diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-04 07:40:46 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-04 07:40:46 +0000 |
commit | 52817c3654518c55de31666848f08d7ac58f8787 (patch) | |
tree | 62892ab98f8b492e241afde8b8371b8d81c09583 | |
parent | 9e0a2170fd9ae9ee3a7545630a685a4a3e2f795a (diff) |
* lib/cgi.rb (CGI::out): specify -x option for nkf.
* lib/cgi.rb (CGI::out): should not convert utf-8 implicitly using
NKF. it is too Japanese centric.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | enum.c | 21 | ||||
-rw-r--r-- | ext/dbm/extconf.rb | 1 | ||||
-rw-r--r-- | lib/cgi.rb | 8 | ||||
-rw-r--r-- | process.c | 2 |
5 files changed, 37 insertions, 6 deletions
@@ -1,3 +1,14 @@ +Mon Sep 4 16:39:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lib/cgi.rb (CGI::out): specify -x option for nkf. + + * lib/cgi.rb (CGI::out): should not convert utf-8 implicitly using + NKF. it is too Japanese centric. + +Mon Sep 4 14:23:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * ext/dbm/extconf.rb (db_check): remove debug print. + Mon Sep 4 06:46:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * parse.y (rb_id2sym): intern if id is attrset_id. @@ -1187,6 +1187,27 @@ enum_zip(int argc, VALUE *argv, VALUE obj) return result; } +static VALUE +in_i(VALUE i, VALUE *memo) +{ + if (rb_equal(i, memo[0])) { + memo[1] = Qtrue; + rb_iter_break(); + } + return Qnil; +} + +VALUE +rb_enum_in(VALUE elem, VALUE obj) +{ + VALUE memo[2]; + + memo[0] = elem; + memo[1] = Qfalse; + rb_block_call(obj, id_each, 0, 0, in_i, (VALUE)&memo); + return memo[1]; +} + /* * The <code>Enumerable</code> mixin provides collection classes with * several traversal and searching methods, and with the ability to diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb index 41996c417c..7a69acc7a6 100644 --- a/ext/dbm/extconf.rb +++ b/ext/dbm/extconf.rb @@ -34,7 +34,6 @@ def db_check(db) for hdr in $dbm_conf_headers.fetch(db, ["ndbm.h"]) if have_header(hdr.dup) and have_type("DBM", hdr.dup, hsearch) $defs << hsearch << '-DDBM_HDR="<'+hdr+'>"' - p $defs return true end end diff --git a/lib/cgi.rb b/lib/cgi.rb index 4cd497849a..8d6705c44a 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -718,16 +718,14 @@ class CGI require "nkf" case options["charset"] when /iso-2022-jp/ni - content = NKF::nkf('-j -m0', content) + content = NKF::nkf('-j -m0 -x', content) options["language"] = "ja" unless options.has_key?("language") when /euc-jp/ni - content = NKF::nkf('-e -m0', content) + content = NKF::nkf('-e -m0 -x', content) options["language"] = "ja" unless options.has_key?("language") when /shift_jis/ni - content = NKF::nkf('-s -m0', content) + content = NKF::nkf('-s -m0 -x', content) options["language"] = "ja" unless options.has_key?("language") - when /utf-8/ni - content = NKF::nkf('-w -m0', content) end end @@ -1173,9 +1173,11 @@ rb_check_argv(int argc, VALUE *argv) prog = RARRAY_PTR(tmp)[0]; argv[0] = RARRAY_PTR(tmp)[1]; SafeStringValue(prog); + StringValueCStr(prog); } for (i = 0; i < argc; i++) { SafeStringValue(argv[i]); + StringValueCStr(argv[i]); } security(RSTRING_PTR(prog ? prog : argv[0])); return prog; |