summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Smith-Mannschott <bsmith.occs@gmail.com>2010-07-25 10:45:12 +0200
committerStuart Halloway <stu@thinkrelevance.com>2010-07-27 16:50:56 -0400
commit278af620d00907c24999b69131adaef95f804988 (patch)
treebe1ca3ceb22348df067d9d7dc4e2eb78096aee59 /src
parent4d8932507a4f914d3bbdab738aa2decad1403d03 (diff)
♯413 parse-args defaults in-enc and out-enc to UTF-8, as required by sh
Previously parse-args was defaulting in-enc and out-enc to the platform default charset. This contradicted the intent of sh, which is to default to UTF-8 on all platforms. This appears not to have been noticed because the unit tests were still testing for the previous behavior of defaulting to platform encoding. (As it turns out the old behavior of using Charset/defaultCharset would have been wrong on Mac OS X since it claims "Mac Roman" here despite the fact that Mac OS X uses UTF-8 throughout, including in Terminal.app, shell and file system.) Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
Diffstat (limited to 'src')
-rw-r--r--src/clj/clojure/java/shell.clj2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/clj/clojure/java/shell.clj b/src/clj/clojure/java/shell.clj
index fa553671..004629df 100644
--- a/src/clj/clojure/java/shell.clj
+++ b/src/clj/clojure/java/shell.clj
@@ -44,7 +44,7 @@ collecting its stdout"}
(defn- parse-args
[args]
- (let [default-encoding (.name (Charset/defaultCharset))
+ (let [default-encoding "UTF-8" ;; see sh doc string
default-opts {:out-enc default-encoding :in-enc default-encoding :dir *sh-dir* :env *sh-env*}
[cmd opts] (split-with string? args)]
[cmd (merge default-opts (apply hash-map opts))]))