From dbd6be6e4baea74051ec63ba7ec8d1666f7eb250 Mon Sep 17 00:00:00 2001 From: attakei Date: Sun, 26 Oct 2014 23:15:18 +0900 Subject: [PATCH] set UTF-8 for android update command explicitly Fix for fail in to update android package. It is happened to meet under the following conditions both. * User environment is not used UTF-8 in default file.encoding in java * Android-sdk license text is included not-ASCII code characters. If user define JAVA_TOOL_OPTIONS in env, inherit it. --- buildozer/targets/android.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index a61be25..4c90a09 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -301,10 +301,12 @@ class TargetAndroid(Target): def _android_update_sdk(self, packages): from buildozer.libs.pexpect import EOF + java_tool_options = environ.get('JAVA_TOOL_OPTIONS', '') child = self.buildozer.cmd_expect('{} update sdk -u -a -t {}'.format( self.android_cmd, packages, cwd=self.buildozer.global_platform_dir), - timeout=None) + timeout=None, + env={'JAVA_TOOL_OPTIONS': java_tool_options + ' -Dfile.encoding=UTF-8'}) while True: index = child.expect([EOF, '[y/n]: ']) if index == 0: