In article [email protected],
Tietew [email protected] writes:
e$B8D?ME*$K$O!"$I$N%U%#!<%k%I$,IT@5$J$N$+$H$$$&$3$H$K6=L#$O$J$$$N$G!"e(B
true/false e$B$,JV$kDxEY$G9=$$$^$;$s!#B>$N?M$N0U8+$bJ9$-$?$$$G$9!#e(B
e$BH4$17j$rKI$0$H$$$&0UL#$G$ONc30$NJ}$,$$$$$N$+$J$"!#e(B
e$BIaDL$ONc30$G!“<+J,$G3N$+$a$k$H$$$&$R$H$N$?$a$K8!::$7$J$$A*Bre(B
e$B;h$r$D$1$k!”$H$$$&$"$?$j$8$c$J$$$G$9$+!#e(B
CGI.new(:accept_encoding=>“…”,
“name1”=>:file,
“name2”=>…)
e$B$G!"8!::$7$J$$$J$ie(B
CGI.new(:accept_encoding=>:no_validation,
“name1”=>:file,
“name2”=>…)
e$B$H$+!#e(B
In article [email protected],
Tanaka A. [email protected] writes:
e$B$G!"8!::$7$J$$$J$ie(B
CGI.new(:accept_encoding=>:no_validation,
e$B8!::$7$J$$$J$ie(B “ASCII-8BIT” e$B$r;XDj$9$k$@$1$G$$$$$+$b!#e(B
e$B@>;3OB9-$G$9!#e(B
At Mon, 22 Sep 2008 18:55:07 +0900,
Tietew wrote:
e$B2?$i$+$N7A$NItJ,$N4uK>$O$"$j$^$9$+!)e(B
e$BNc$($Pe(B@encoding_errorse$B$Ne(Barraye$B$r:n$C$F9`L\L>$r%W%C%7%e$9$k$H$+e(B
e$B8D?ME*$K$O!"$I$N%U%#!<%k%I$,IT@5$J$N$+$H$$$&$3$H$K6=L#$O$J$$$N$G!"e(B
true/false e$B$,JV$kDxEY$G9=$$$^$;$s!#B>$N?M$N0U8+$bJ9$-$?$$$G$9!#e(B
e$BH4$17j$rKI$0$H$$$&0UL#$G$ONc30$NJ}$,$$$$$N$+$J$"!#e(B
e$BIT@5%(%s%3!<%G%#%s%0$r8!=P$7$?$H$-$K<B9T$9$k%V%m%C%/$r;XDj$G$-$ke(B
e$B$h$&$K$7$F!";XDj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C$?%U%#!<%k%I$K2?$+0u$r$D$1$k$N$K;H$($k$+$b!"e(B
e$B$H$$$&%$%a!<%8$G$9!#e(B
invalid_fields = {}
cgi = CGI.new(…, :… =>proc {|field_name, field_value|
invalid_fields[field_name] = field_value
})
…
cgi.out(…) {
…
cgi.text_field({…,“name”=>“some_text”, “class”=>
invalid_fields.include?(“some_text”) ? “invalid” : “”
})
…
}
e$BF#2,$G$9!#e(B
…
cgi.text_field({…,“name”=>“some_text”, “class”=>
invalid_fields.include?(“some_text”) ? “invalid” : “”
})
…
}
e$B$3$s$J46$8$G$7$g$&$+!#e(B
invalid_fields={}
cgi=CGI.new(:accept_charset=>“EUC-JP”){|field_name,field_value|
invalid_fields[field_name] = field_value
}
e$B$3$s$J46$8$G;H$($^$9!#e(Bnewe$B$N%V%m%C%/$KEO$9$N$O$$$$$N$+$I$&$+HyL/$G$9$,!#e(B
e$B%a%=%C%I$N%V%m%C%/$,6u$$$F$$$k$N$G5M$a9~$s$G$_$^$7$?!#e(B
Index: lib/cgi/core.rb
— lib/cgi/core.rb (e$B%j%S%8%g%se(B 19454)
+++ lib/cgi/core.rb (e$B:n6H%3%T!<e(B)
@@ -598,8 +598,21 @@
stdinput.read(Integer(env_table[‘CONTENT_LENGTH’])) or ‘’
else
read_from_cmdline
@accept_charset!=Encoding::ASCII_8BIT
-
@params.each do |key,values|
-
values.each do |value|
-
unless value.valid_encoding?
-
if @accept_charset_error_block
-
@accept_charset_error_block.call(key,value)
-
else
-
raise "Accept-Charset encoding error"
-
end
-
end
-
end
-
end
-
end
end
@cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] or
env_table[‘COOKIE’]))
@@ -665,7 +678,24 @@
from the command line or (failing that) from standard input.
Otherwise,
cookies and other parameters are parsed automatically from the
standard
CGI locations, which varies according to the REQUEST_METHOD.
- def initialize(type = “query”)
- case @options[:tag_maker]
when “html3”
require ‘cgi/html’
extend Html3
e$BF#2,$G$9!#e(B
e$B$3$s$J46$8$G$7$g$&$+!#e(B
invalid_fields={}
cgi=CGI.new(:accept_charset=>“EUC-JP”){|field_name,field_value|
invalid_fields[field_name] = field_value
}
e$B$3$s$J46$8$G;H$($^$9!#e(Bnewe$B$N%V%m%C%/$KEO$9$N$O$$$$$N$+$I$&$+HyL/$G$9$,!#e(B
e$B%a%=%C%I$N%V%m%C%/$,6u$$$F$$$k$N$G5M$a9~$s$G$_$^$7$?!#e(B
e$BBg$-$JH?BP$,$J$1$l$PL@F|$"$?$j$K$H$j$"$($:%3%_%C%H$7$F$7$^$&M=Dj$G$9!#e(B
e$B%^%k%A%Q!<%H$N$[$&$O$^$@2?$b$d$C$F$$$^$;$s$,!"e(B
e$B%(%s%3!<%G%#%s%00JA0$KF0$-$=$&$K$J$$$N$G!"e(B
e$B:#8eBP1~$7$F$$$-$^$9!#e(B