aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/library/cgi/escapeHTML_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/cgi/escapeHTML_spec.rb')
-rw-r--r--spec/ruby/library/cgi/escapeHTML_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/library/cgi/escapeHTML_spec.rb b/spec/ruby/library/cgi/escapeHTML_spec.rb
index dcbfebe720..421aac5d4a 100644
--- a/spec/ruby/library/cgi/escapeHTML_spec.rb
+++ b/spec/ruby/library/cgi/escapeHTML_spec.rb
@@ -6,6 +6,10 @@ describe "CGI.escapeHTML" do
CGI.escapeHTML(%[& < > " ']).should == '&amp; &lt; &gt; &quot; &#39;'
end
+ it "escapes invalid encoding" do
+ CGI.escapeHTML(%[<\xA4??>]).should == "&lt;\xA4??&gt;"
+ end
+
it "does not escape any other characters" do
chars = " !\#$%()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
CGI.escapeHTML(chars).should == chars