Skip to content

Commit

Permalink
set charset (#238)
Browse files Browse the repository at this point in the history
default file charset is not utf8 when run from win10
  • Loading branch information
islq authored and Anuken committed Oct 13, 2018
1 parent c526997 commit ebc4031
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/src/io/anuke/mindustry/BundleLauncher.java
Expand Up @@ -10,6 +10,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand All @@ -29,7 +30,7 @@ public static void main(String[] args) throws Exception{
Log.info("Parsing bundle: {0}", child);

OrderedMap<String, String> other = new OrderedMap<>();
PropertiesUtils.load(other, Files.newBufferedReader(child));
PropertiesUtils.load(other, Files.newBufferedReader(child, Charset.forName("UTF-8")));
removals.clear();

for(String key : other.orderedKeys()){
Expand Down Expand Up @@ -62,12 +63,12 @@ public static void main(String[] args) throws Exception{
result.append(e.toString().replace("\\", "\\\\").replace("\n", "\\n"));
result.append("\n");
}
Files.write(child, result.toString().getBytes());
Files.write(child, result.toString().getBytes("UTF-8"));

}catch (IOException e){
throw new RuntimeException(e);
}
});
}

}
}

0 comments on commit ebc4031

Please sign in to comment.