Noticed you're using FileReader in com.google.cloud.ServiceOptions and possibly elsewhere. This is potentially buggy because it depends on the platform default encoding and thus behavior can change from one system to the next. Instead, try an InputStreamReader with a specified encoding chained to a FileInputStream.
protected static String googleCloudProjectId() {
File configDir;
if (System.getenv().containsKey("CLOUDSDK_CONFIG")) {
configDir = new File(System.getenv("CLOUDSDK_CONFIG"));
} else if (isWindows() && System.getenv().containsKey("APPDATA")) {
configDir = new File(System.getenv("APPDATA"), "gcloud");
} else {
configDir = new File(System.getProperty("user.home"), ".config/gcloud");
}
String activeConfig = activeGoogleCloudConfig(configDir);
FileReader fileReader = null;
try {
fileReader = new FileReader(new File(configDir, "configurations/config_" + activeConfig));
} catch (FileNotFoundException newConfigFileNotFoundEx) {
try {
fileReader = new FileReader(new File(configDir, "properties"));
} catch (FileNotFoundException oldConfigFileNotFoundEx) {
// ignore
}
}
Noticed you're using FileReader in
com.google.cloud.ServiceOptionsand possibly elsewhere. This is potentially buggy because it depends on the platform default encoding and thus behavior can change from one system to the next. Instead, try an InputStreamReader with a specified encoding chained to a FileInputStream.