Skip to content

Commit cfd53b7

Browse files
committed
Better windows support
1 parent e31ce70 commit cfd53b7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

java.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@
2525
'java_args': [],
2626
'bytecode': False,
2727
'mvn': [],
28-
'javac_args': ['-nowarn'],
28+
'javac_args': ['-nowarn', '-encoding', 'utf-8'],
2929
'timings': False,
3030
'debug': False,
3131
}
3232

33-
OUT = '/tmp/java.py'
33+
OUT = os.path.join('/tmp' if os.name != 'nt' else os.getenv('temp'),
34+
'java.py')
3435
CLASS = 'Paul%s' % int(random.random() * 100)
3536
SOURCE = '%s.java' % CLASS
3637
COMPILED = '%s.class' % CLASS
@@ -277,7 +278,7 @@ def write_to_file(file, content):
277278
if not os.path.exists(dirname):
278279
os.mkdir(dirname)
279280

280-
with open(file, 'w') as f:
281+
with open(file, 'w', encoding='utf-8') as f:
281282
f.write(content)
282283

283284
def which(name):

0 commit comments

Comments
 (0)