remotes cannot receive (to clojure) some unicode characters in strings #12

terjesb opened this Issue May 21, 2012 · 0 comments


None yet

1 participant

terjesb commented May 21, 2012

I was just bitten by this, which seems to be identical to pinot issue 16, ibdknox/pinot#16, reported by davesann. This is with latest available fetch/noir on Clojure 1.4.0, both OS X 10.7, OpenJDK 1.7 and Ubuntu 12.04, OpenJDK 1.7, and as far as I can tell everything is UTF-8.

It works fine retrieving a value like 'tésting' from the remote, but not posting the same.

There was also a discussion about read-string on the clojure list!topic/clojure/Kl3WVtEE3FY, but I'm not sure if a fix there has been agreed upon yet. (The wiki page linked to there doesn't work for me right now.)

java.lang.RuntimeException: Unsupported escape character: \x
at clojure.lang.Util.runtimeException(
at clojure.lang.LispReader$StringReader.invoke(
at clojure.lang.LispReader.readDelimitedList(
at clojure.lang.LispReader$MapReader.invoke(
at clojure.lang.LispReader.readDelimitedList(
at clojure.lang.LispReader$VectorReader.invoke(
at clojure.lang.RT.readString(
at clojure.core$read_string.invoke(core.clj:3361)
at noir.fetch.remotes$safe_read.invoke(remotes.clj:14)
at noir.fetch.remotes$ANY___fetch.invoke(remotes.clj:

I am currently investigating if davesann's proposed fix works for me:

(defn unescape [string]
    string #"\\x(..)" 
    (fn [m] (str (char (Integer/parseInt (second m) 16))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment