Skip to content

Commit 404d644

Browse files
S. Zharinovdnolen
authored andcommitted
CLJS-1547: Wrong output encoding when compile with goog.LOCALE
Closure Compiler uses ASCII by default because of legacy reasons. Non-ASCII characters are escaped. It may lead to larger builds when using i18n facilities. Also, when using goog.i18n with custom goog.LOCALE option, REPL users can see formatted dates in legacy encodings of their languages (for example, CP1252 for goog.LOCALE="ru"). This patch provides UTF-8 encoding by default. Possible options are: * US-ASCII (current default) * ISO-8859-1 * UTF-8 (proposed default) * UTF-16BE * UTF-16LE * UTF-16 (https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html)
1 parent 628d957 commit 404d644

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/clojure/cljs/closure.clj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@
211211
(. compiler-options
212212
(setExtraAnnotationNames (map name (:closure-extra-annotations opts)))))
213213

214+
(. compiler-options
215+
(setOutputCharset (:closure-output-charset opts "UTF-8")))
216+
214217
compiler-options)
215218

216219
(defn ^CompilerOptions make-options

0 commit comments

Comments
 (0)