From 3e396b3782813d36d46195564cd0e111422bcaf5 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Tue, 22 Jun 2021 22:59:16 +0200 Subject: fix: Always explicitly set encoding for text files (fixes #8263) --- mesonbuild/compilers/java.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/compilers/java.py') diff --git a/mesonbuild/compilers/java.py b/mesonbuild/compilers/java.py index 77e1a9b..ab82450 100644 --- a/mesonbuild/compilers/java.py +++ b/mesonbuild/compilers/java.py @@ -70,7 +70,7 @@ class JavaCompiler(BasicLinkerIsCompilerMixin, Compiler): src = 'SanityCheck.java' obj = 'SanityCheck' source_name = os.path.join(work_dir, src) - with open(source_name, 'w') as ofile: + with open(source_name, 'w', encoding='utf-8') as ofile: ofile.write(textwrap.dedent( '''class SanityCheck { public static void main(String[] args) { -- cgit v1.1