   [#^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))

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

(defmacro defnail

     (.start))))

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

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