Skip to content

Commit dd255b7

Browse files
committed
1 parent 07421f2 commit dd255b7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/building.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,8 @@ def closure_compiler(filename, advanced=True, extra_closure_args=None):
606606
args += ['--language_out', 'NO_TRANSPILE']
607607
# Tell closure never to inject the 'use strict' directive.
608608
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']
609611

610612
if settings.IGNORE_CLOSURE_COMPILER_ERRORS:
611613
args.append('--jscomp_off=*')
@@ -656,7 +658,8 @@ def move_to_safe_7bit_ascii_filename(filename):
656658
# 7-bit ASCII range. Therefore make sure the command line we pass does not contain any such
657659
# input files by passing all input filenames relative to the cwd. (user temp directory might
658660
# 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')
660663

661664
# XXX Closure bug: if Closure is invoked with --create_source_map, Closure should create a
662665
# outfile.map source map file (https://github.com/google/closure-compiler/wiki/Source-Maps)

0 commit comments

Comments
 (0)