   [#^NGContext ctx nail]
   (let [out          (ByteArrayOutputStream.)
         err          (ByteArrayOutputStream.)
-        [clj-in clj-out clj-err] (make-stream-set (.in ctx) out err)
-        encoding     (if-let [encoding (System/getProperty "clojure.vim.encoding")]
-                       encoding
-                       "UTF-8")
+        encoding     (System/getProperty "clojure.vim.encoding" "UTF-8")
+        [clj-in clj-out clj-err] (make-stream-set (.in ctx) out err encoding)
         sys-in       (set-input-stream System/in (.in ctx))
         sys-out      (set-output-stream System/out (PrintStream. out))
         sys-err      (set-output-stream System/err (PrintStream. err))

     (.start))))

(defn- make-stream-set
  [in out err]
  [(-> in InputStreamReader. LineNumberingPushbackReader.)
   (-> out OutputStreamWriter.)
   (-> err OutputStreamWriter. PrintWriter.)])

(defn- set-input-stream
  [#^ThreadLocalInputStream sys local]

    (set-input-stream System/in sys-in)
    (set-output-stream System/out sys-out)
    (set-output-stream System/err sys-err)
    (let [output (.getBytes
                   (print-str
                     (util/clj->vim
                       {:value  result
                        :stdout (.toString out encoding)
                        :stderr (.toString err encoding)}))
                   encoding)]
      (.write (.out ctx) output 0 (alength output)))
    (.flush (.out ctx))))

(defmacro defnail
