From 0f0f79d34bed4ef5f2b1055aca6eedfacde60470 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 14 Dec 2007 17:05:15 +0000 Subject: * lib/rdoc/options.rb (Options::parse): do not access $KCODE any longer. [ruby-core:14079] * lib/irb/init.rb (IRB::IRB.parse_opts): ditto. * lib/cgi.rb (CGI::CGI): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/cgi.rb | 12 ++---------- lib/irb/init.rb | 2 -- lib/rdoc/options.rb | 9 +-------- 3 files changed, 3 insertions(+), 20 deletions(-) (limited to 'lib') diff --git a/lib/cgi.rb b/lib/cgi.rb index fad6d3f468..9af4c9cf24 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -378,21 +378,13 @@ class CGI if Integer($1) < 256 Integer($1).chr else - if Integer($1) < 65536 and ($KCODE[0] == ?u or $KCODE[0] == ?U) - [Integer($1)].pack("U") - else - "&##{$1};" - end + "&##{$1};" end when /\A#x([0-9a-f]+)\z/ni then if $1.hex < 256 $1.hex.chr else - if $1.hex < 65536 and ($KCODE[0] == ?u or $KCODE[0] == ?U) - [$1.hex].pack("U") - else - "&#x#{$1};" - end + "&#x#{$1};" end else "&#{match};" diff --git a/lib/irb/init.rb b/lib/irb/init.rb index 0fd54ee806..3b455ec582 100644 --- a/lib/irb/init.rb +++ b/lib/irb/init.rb @@ -140,8 +140,6 @@ module IRB when /^-I(.+)?/ opt = $1 || ARGV.shift load_path.concat(opt.split(File::PATH_SEPARATOR)) if opt - when /^-K(.)/ - $KCODE = $1 when "--inspect" @CONF[:INSPECT_MODE] = true when "--noinspect" diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index bea7e6bdcd..84d92424a3 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -375,14 +375,7 @@ class Options @css = nil @webcvs = nil - @charset = case $KCODE - when /^S/i - 'Shift_JIS' - when /^E/i - 'EUC-JP' - else - 'iso-8859-1' - end + @charset = 'iso-8859-1' accessors = [] -- cgit v1.2.3