Permalink
Browse files

urldecode uses UTF-8 as charset

  • Loading branch information...
1 parent aba1a38 commit 2b7fd30ce79b5da687225cc824e00436d8d667cf @weavejester committed Mar 5, 2011
Showing with 5 additions and 1 deletion.
  1. +1 −1 src/clout/core.clj
  2. +4 −0 test/clout/test/core.clj
View
@@ -28,7 +28,7 @@
(defn- urldecode
"Encode a urlencoded string using the default encoding."
[string]
- (URLDecoder/decode string))
+ (URLDecoder/decode string "UTF-8"))
(defn- assoc-vec
"Associate a key with a value. If the key already exists in the map, create a
@@ -51,6 +51,10 @@
"/:Ä-ü" "/baz" {:Ä-ü "baz"}
"/:Ä_ü" "/baz" {:Ä_ü "baz"}))
+(deftest utf8-routes
+ (is (= (route-matches "/:x" (request :get "/gro%C3%9Fp%C3%B6sna"))
+ {:x "großpösna"})))
+
(deftest wildcard-paths
(are [path uri params] (= (route-matches path (request :get uri)) params)
"/*" "/foo" {:* "foo"}

0 comments on commit 2b7fd30

Please sign in to comment.