@@ -606,6 +606,8 @@ def closure_compiler(filename, advanced=True, extra_closure_args=None):
606
606
args += ['--language_out' , 'NO_TRANSPILE' ]
607
607
# Tell closure never to inject the 'use strict' directive.
608
608
args += ['--emit_use_strict=false' ]
609
+ # Always output UTF-8 files, this helps generate UTF-8 code points instead of escaping code points with \uxxxx inside strings. https://github.com/google/closure-compiler/issues/4158
610
+ args += ['--charset=UTF8' ]
609
611
610
612
if settings .IGNORE_CLOSURE_COMPILER_ERRORS :
611
613
args .append ('--jscomp_off=*' )
@@ -656,7 +658,8 @@ def move_to_safe_7bit_ascii_filename(filename):
656
658
# 7-bit ASCII range. Therefore make sure the command line we pass does not contain any such
657
659
# input files by passing all input filenames relative to the cwd. (user temp directory might
658
660
# be in user's home directory, and user's profile name might contain unicode characters)
659
- proc = run_process (cmd , stderr = PIPE , check = False , env = env , cwd = tempfiles .tmpdir )
661
+ # https://github.com/google/closure-compiler/issues/4159: Closure outputs stdout/stderr in iso-8859-1 on Windows.c
662
+ proc = run_process (cmd , stderr = PIPE , check = False , env = env , cwd = tempfiles .tmpdir , encoding = 'iso-8859-1' if WINDOWS else 'utf-8' )
660
663
661
664
# XXX Closure bug: if Closure is invoked with --create_source_map, Closure should create a
662
665
# outfile.map source map file (https://github.com/google/closure-compiler/wiki/Source-Maps)
0 commit comments