<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -16,6 +16,7 @@
   (:use compojure.str-utils)
   (:use compojure.map-utils)
   (:use compojure.control)
+  (:use compojure.encodings)
   (:import java.util.regex.Pattern)
   (:import java.util.Map))
 
@@ -95,7 +96,7 @@
   (reduce
     (fn [m [k v]] (assoc-vec m k v))
     {}
-    (map vector keywords (rest groups))))
+    (map vector keywords groups)))
 
 (defmulti match-uri
   &quot;Match a URL against a compiled URI-matcher or a regular expression. Returns
@@ -107,7 +108,7 @@
   (let [matcher (re-matcher (uri-matcher :regex) (or uri &quot;/&quot;))]
     (if (.matches matcher)
       (assoc-keywords-with-groups
-        (re-groups matcher)
+        (map urldecode (re-groups* matcher))
         (uri-matcher :keywords)))))
 
 (defmethod match-uri Pattern
@@ -115,7 +116,7 @@
   (let [matches (re-matches uri-pattern (or uri &quot;/&quot;))]
     (if matches
       (if (vector? matches)
-        (subvec matches 1)
+        (vec (map urldecode (rest matches)))
         []))))
 
 (defn match-method</diff>
      <filename>src/compojure/http/routes.clj</filename>
    </modified>
    <modified>
      <diff>@@ -52,6 +52,13 @@
   [string]
   (escape &quot;\\.*+|?()[]{}$^&quot; string))
 
+(defn re-groups*
+  &quot;More consistant re-groups that always returns a vector of groups, even if
+  there is only one group.&quot;
+  [matcher]
+  (for [i (range (.groupCount matcher))]
+    (.group matcher (inc i))))
+
 (defn blank?
   &quot;True if s = \&quot;\&quot; or nil&quot;
   [s]</diff>
      <filename>src/compojure/str_utils.clj</filename>
    </modified>
    <modified>
      <diff>@@ -30,6 +30,11 @@
     &quot;/:foo-bar&quot; &quot;/baz&quot; {:foo-bar &quot;baz&quot;}
     &quot;/:foo-&quot;    &quot;/baz&quot; {:foo- &quot;baz&quot;}))
 
+(deftest urlencoded-keywords
+  (are (= (match-uri (compile-uri-matcher _1) _2) _3)
+    &quot;/:x&quot; &quot;/foo%20bar&quot; {:x &quot;foo bar&quot;}
+    &quot;/:x&quot; &quot;/foo+bar&quot;   {:x &quot;foo bar&quot;}))
+
 (deftest same-keyword-many-times
   (are (= (match-uri (compile-uri-matcher _1) _2) _3)
     &quot;/:x/:x/:x&quot; &quot;/a/b/c&quot; {:x [&quot;a&quot; &quot;b&quot; &quot;c&quot;]}</diff>
      <filename>test/compojure/http/routes.clj</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>81fae95902f645ef3912fabb38dfcef9d29b6224</id>
    </parent>
  </parents>
  <author>
    <name>James Reeves</name>
    <email>jim@bonobo.(none)</email>
  </author>
  <url>http://github.com/abedra/compojure/commit/513769433e9fae4919268c4ca67dfb108eb6f9e2</url>
  <id>513769433e9fae4919268c4ca67dfb108eb6f9e2</id>
  <committed-date>2009-09-26T11:20:00-07:00</committed-date>
  <authored-date>2009-09-26T11:20:00-07:00</authored-date>
  <message>Fixes #15: route params should be urldecoded</message>
  <tree>724058b3284920067351d894123e16b55e908bbb</tree>
  <committer>
    <name>James Reeves</name>
    <email>jim@bonobo.(none)</email>
  </committer>
</commit>
