Permalink
Browse files

Merge pull request #21 from Gozala/bug/unicode

Fix compiler support for unicode strings #10
  • Loading branch information...
2 parents c483464 + e666270 commit bd8a4cd91f57e98feef78120b0f7c479046f4c41 @kanaka committed Jan 21, 2013
Showing with 4 additions and 1 deletion.
  1. +2 −1 src/cljs/cljs/compiler.cljs
  2. +2 −0 test/cljs/cljs/quick.cljs
@@ -116,7 +116,8 @@
9 "\\t"
(if (< 31 cp 127)
c ; Print simple ASCII characters
- (format "\\u%04X" cp))))) ; Any other character is Unicode
+ ; Any other character is Unicode
+ (apply str "\\u" (take-last 4 (str "0000" (.toString cp 16))))))))
(defn- escape-pattern [^String pattern]
(-> pattern
@@ -48,6 +48,8 @@
(assert (= '(3 6 9 12) (seq (let [a (array 1 2 3 4)] (amap a i ret (* 3 (aget a i)))))))
(assert (= 25 (let [a (array 1 2 3 4 5)] (areduce a i ret 10 (+ ret (aget a i))))))
+ ;; unicode
+ (assert (= "ü" "\u00fc") "unicodes are read properly")
;; Macros
(assert (= 5 (quick-mac 5)))

0 comments on commit bd8a4cd

Please sign in to comment.