Den 16 januari 2012 16:58 skrev joachim <joachim.de.be...@gmail.com>: > However, when I try the same in an emacs repl, I get "Lisp connection > closed unexpectedly: connection broken by remote peer". I have no idea > what is going on or how to deal with this problem. Sometimes during > development I like to print the strings to see what is going on, but > this also causes the connection to close.
> Any ideas? > > Joachim. >From what I can tell those characters are indeed characters outside the Basic Multilingual Plane. They should not cause any problems in Clojure itself if you merely relay them through your app. (They have some quirks though. For example they count as two characters.) First I thought this was another very common problem, namely the issue Ulises linked to, but then I tried to print supplementary characters myself in my (correctly configured) slime repl and it failed there too! This is obviously a bug in either slime or swank-clojure. Could you open an issue in the swank-clojure github repo for this, so we can track the progress? https://github.com/technomancy/swank-clojure/issues Den 16 januari 2012 16:58 skrev joachim <joachim.de.be...@gmail.com>: > I would also be happy if I could recognize "problematic" strings, so > that I can skip them when printing, thus avoiding the problem > (although this would not really be a solution), You can use this as a temporary workaround: (require '[clojure.string :as str]) (defn strip-supplementary [s] (str/replace s #"[^\u0000-\uFFFF]+" "(removed supplementary characters)")) (strip-supplementary "The first three letters of the Gothic alphabet are: \uD800\uDF30\uD800\uDF31\uD800\uDF32") ;=> "The first three letters of the Gothic alphabet are: (removed supplementary characters)" // Rasmus -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en