Skip to content

Commit

Permalink
Fix an encoding issue (#635)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzyray authored and zsalch committed Oct 12, 2019
1 parent 6b9c789 commit cb964a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/featurecat/lizzie/rules/SGFParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static boolean load(String filename) throws IOException {
}

String encoding = EncodingDetector.detect(filename);
if (encoding == "WINDOWS-1252") encoding = "gb2312";
FileInputStream fp = new FileInputStream(file);
InputStreamReader reader = new InputStreamReader(fp, encoding);
StringBuilder builder = new StringBuilder();
Expand Down Expand Up @@ -279,7 +280,8 @@ private static BoardHistoryList parseValue(
line2 = lines[1];
}
String versionNumber = line1[0];
line1[1] = line1[1].replaceAll(",", "."); // fix a decimal representation localization issue
line1[1] =
line1[1].replaceAll(",", "."); // fix a decimal representation localization issue
Lizzie.board.getData().winrate = 100 - Double.parseDouble(line1[1]);
int numPlayouts =
Integer.parseInt(
Expand Down

0 comments on commit cb964a9

Please sign in to comment.