Permalink
Browse files

Added a new "swank.encoding" propertly to allow you to set the encodi…

…ng of an embedded REPL.

For example (for UTF-8):

  JAVA_OPTS="-Dswank.encoding=utf-8-unix" lein swank
  • Loading branch information...
1 parent a04d0f7 commit 557ce487504515eb2b012e16d427160124e83285 @marktriggs marktriggs committed with Mar 17, 2010
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/swank/swank.clj
View
@@ -61,17 +61,20 @@
"Start the server wrapped in a repl. Use this to embed swank in your code."
([port & opts]
(let [stop (atom false)
- opts (merge {:port port :encoding "iso-latin-1-unix"}
- (apply hash-map opts))]
+ opts (merge {:port port
+ :encoding (or (System/getProperty
+ "swank.encoding")
+ "iso-latin-1-unix")}
+ (apply hash-map opts))]
(repl :read (fn [rprompt rexit]
(if @stop rexit
(do (swap! stop (fn [_] true))
`(do (ignore-protocol-version nil)
(start-server (-> "java.io.tmpdir"
(System/getProperty)
(File. "slime-port.txt")
- (.getCanonicalPath)))
- ~@(apply concat opts)))))
+ (.getCanonicalPath))
+ ~@(apply concat opts))))))
:need-prompt #(identity false))))
([] (start-repl 4005)))

0 comments on commit 557ce48

Please sign in to comment.