<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -43,7 +43,11 @@ class CGI
   #      # =&gt; &quot;Usage: foo \&quot;bar\&quot; &lt;baz&gt;&quot;
   def self.unescapeHTML(string)
     table = UNESCAPE_ENTITIES
-    utf8_p = $KCODE[0] == ?u || $KCODE[0] == ?U
+    if &quot;&quot;.respond_to?(:encoding)              # Ruby1.9
+      utf8_p = true       # really?
+    else
+      utf8_p = $KCODE[0] == ?u || $KCODE[0] == ?U
+    end
     return string.gsub(/&amp;#?[a-zA-F0-9]+;/n) do
       match = $&amp;
       key = match[1..-2]</diff>
      <filename>lib/cgialt/util.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ require 'test/unit'
 #require 'cgi'
 require(ENV['CGI'] || 'cgialt')
 
+
 if defined?(CGIExt)
   def if_cgiext;  yield if block_given?; true;  end
   def if_cgialt;  false;  end
@@ -10,6 +11,7 @@ else
   def if_cgialt;  yield if block_given?; true;  end
 end
 
+
 class CGIUtilTest &lt; Test::Unit::TestCase
 
   def test_escape_html
@@ -38,7 +40,7 @@ class CGIUtilTest &lt; Test::Unit::TestCase
   end
 
 
-if_cgiext do
+if_cgiext {
   def test_escape_html!
     ## escape html characters
     input = '&lt;&gt;&amp;&quot;\''
@@ -62,22 +64,22 @@ if_cgiext do
     actual = CGIExt.escape_html!(input)
     assert_equal(expected, actual)
   end
-end
+}
 
 
   def test_unescape_html
     ## unescape html characters
     tdata = [
       ## html entities ('&lt;&gt;&amp;&quot;')
-#      ['&amp;lt;&amp;gt;&amp;amp;&amp;quot;', '&lt;&gt;&amp;&quot;'],
+      ['&amp;lt;&amp;gt;&amp;amp;&amp;quot;', '&lt;&gt;&amp;&quot;'],
       ## otehr html entities (ex. '&amp;copy;')
-#      ['&amp;copy;&amp;heart;', '&amp;copy;&amp;heart;'],
+      ['&amp;copy;&amp;heart;', '&amp;copy;&amp;heart;'],
       ## '&amp;#99' format
       ['&amp;#34;&amp;#38;&amp;#39;&amp;#60;&amp;#62;', '&quot;&amp;\'&lt;&gt;'],
       ## '&amp;#x9999' format
-#      ['&amp;#x0022;&amp;#x0026;&amp;#x0027;&amp;#x003c;&amp;#x003E;', '&quot;&amp;\'&lt;&gt;'],
+      ['&amp;#x0022;&amp;#x0026;&amp;#x0027;&amp;#x003c;&amp;#x003E;', '&quot;&amp;\'&lt;&gt;'],
       ## invalid format
-#      ['&amp;&amp;lt;&amp;amp&amp;gt;&amp;quot&amp;abcdefghijklmn', '&amp;&lt;&amp;amp&gt;&amp;quot&amp;abcdefghijklmn'],
+      ['&amp;&amp;lt;&amp;amp&amp;gt;&amp;quot&amp;abcdefghijklmn', '&amp;&lt;&amp;amp&gt;&amp;quot&amp;abcdefghijklmn'],
     ]
     actual = nil
     tdata.each do |input, expected|
@@ -116,6 +118,7 @@ end
       [&quot;\244\242\244\244\244\246\244\250\244\252&quot;, &quot;%A4%A2%A4%A4%A4%A6%A4%A8%A4%AA&quot;],
   ]
 
+
   def test_escape_url
     ## encode url string
     testdata = TESTDATA_FOR_ESCAPE_URL + [
@@ -223,9 +226,14 @@ end
     end
     ## default value is frozen empty array
     assert_equal(actual['unknownkey'], [])
-    assert_raise(TypeError) do
-      actual['unknownkey'] &lt;&lt; 'foo'
+    ex = nil
+    if &quot;&quot;.respond_to?(:encoding)      # Ruby1.9
+      errclass = RuntimeError
+    else
+      errclass = TypeError
     end
+    ex = assert_raise(errclass) { actual['unknownkey'] &lt;&lt; 'foo' }
+    assert_equal(&quot;can't modify frozen array&quot;, ex.message)
   end
 
 </diff>
      <filename>test/test_cgi_util.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>01a7d7d6573c3b0f9393a45ef442413a73a7ae75</id>
    </parent>
  </parents>
  <author>
    <name>makoto kuwata</name>
    <email>kwa@kuwata-lab.com</email>
  </author>
  <url>http://github.com/kwatch/cgialt/commit/0d1250b7ceda8ae8b49a28ff3769c80ef6947fa5</url>
  <id>0d1250b7ceda8ae8b49a28ff3769c80ef6947fa5</id>
  <committed-date>2008-11-08T15:11:33-08:00</committed-date>
  <authored-date>2008-11-08T15:11:33-08:00</authored-date>
  <message>[change] CGI.unescapeHTML(): changed not to use $KCODE when Ruby1.9.</message>
  <tree>c2fb86b44c95ff1005bebb5b3feda7fede99d0fa</tree>
  <committer>
    <name>makoto kuwata</name>
    <email>kwa@kuwata-lab.com</email>
  </committer>
</commit>
