Project

General

Profile

Actions

Bug #475

closed

cgi.rbにNKFに依存したコードが入っている

Added by xibbar (Takeyuki FUJIOKA) over 14 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-dev:35922]

Description

=begin
m17nが入ってNKFとかはもう使われないはずなのと、
日本語だけ自動的にheaderのlanguageにjaを入れるというのも
おかしな話だと思うので1.9からは削除した方がいいと思います。

Index: lib/cgi.rb

--- lib/cgi.rb (リビジョン 18779)
+++ lib/cgi.rb (作業コピー)
@@ -715,21 +715,6 @@
options = { "type" => options } if options.kind_of?(String)
content = yield

  • if options.has_key?("charset")
  •  require "nkf"
    
  •  case options["charset"]
    
  •  when /iso-2022-jp/ni
    
  •    content = NKF::nkf('-j -m0 -x', content)
    
  •    options["language"] = "ja" unless options.has_key?("language")
    
  •  when /euc-jp/ni
    
  •    content = NKF::nkf('-e -m0 -x', content)
    
  •    options["language"] = "ja" unless options.has_key?("language")
    
  •  when /shift_jis/ni
    
  •    content = NKF::nkf('-s -m0 -x', content)
    
  •    options["language"] = "ja" unless options.has_key?("language")
    
  •  end
    
  • end
  • options["length"] = content.bytesize.to_s
    output = stdoutput
    output.binmode if defined? output.binmode
    =end
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0