Skip to content

Commit

Permalink
Fix building apps with non-ASCII app names
Browse files Browse the repository at this point in the history
Change-Id: Idf2d133b1c3007a545af6a99c8e0b085bb9adb35
  • Loading branch information
ewpatton authored and jisqyv committed Aug 24, 2021
1 parent 84beed5 commit 0744d21
Showing 1 changed file with 3 additions and 12 deletions.
Expand Up @@ -11,6 +11,7 @@
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;
Expand Down Expand Up @@ -145,11 +146,8 @@ public Project(File file) {

// 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();
Expand Down Expand Up @@ -264,14 +262,7 @@ public String getUsesLocation() {
* @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));
}

/**
Expand Down

0 comments on commit 0744d21

Please sign in to comment.