diff options
Diffstat (limited to 'src/clojure/contrib/json/write.clj')
-rw-r--r-- | src/clojure/contrib/json/write.clj | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clojure/contrib/json/write.clj b/src/clojure/contrib/json/write.clj index 77f04cf5..0ec4fc98 100644 --- a/src/clojure/contrib/json/write.clj +++ b/src/clojure/contrib/json/write.clj @@ -74,7 +74,7 @@ Within strings, all non-ASCII characters are hexadecimal escaped. (defmethod print-json nil [x] (print "null")) -(defmethod print-json ::symbol [x] (pr (name x))) +(defmethod print-json ::symbol [x] (print-json (name x))) (defmethod print-json ::array [s] (print \[) @@ -178,3 +178,6 @@ Within strings, all non-ASCII characters are hexadecimal escaped. (deftest- error-on-nil-keys (is (thrown? Exception (json-str {nil 1})))) + +(deftest- characters-in-symbols-are-escaped + (is (= "\"foo\\u1b1b\"" (json-str (symbol "foo\u1b1b")))))
\ No newline at end of file |