Commit 0744d21c authored by Evan W. Patton's avatar Evan W. Patton Committed by Jeffrey Schiller

Fix building apps with non-ASCII app names

Change-Id: Idf2d133b1c3007a545af6a99c8e0b085bb9adb35
parent 84beed57
......@@ -11,6 +11,7 @@ import com.google.common.collect.Lists;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Properties;
......@@ -145,11 +146,8 @@ public final class Project {
// Load project file
properties = new Properties();
FileInputStream in = new FileInputStream(file);
try {
try (InputStreamReader in = new InputStreamReader(new FileInputStream(file))) {
properties.load(in);
} finally {
in.close();
}
} catch (IOException e) {
e.printStackTrace();
......@@ -264,14 +262,7 @@ public final class Project {
* @return app name
*/
public String getAName() {
//The non-English character set can't be shown properly and need special encoding.
String appName = properties.getProperty(ANAMETAG);
try {
appName = new String(appName.getBytes("ISO-8859-1"), "UTF-8");
} catch (UnsupportedEncodingException e) {
} catch (NullPointerException e) {
}
return appName;
return properties.getProperty(ANAMETAG, properties.getProperty(NAMETAG));
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment