Make configuration use utf8
This commit is contained in:
parent
94aafd7b7c
commit
c2f715fb46
1 changed files with 3 additions and 2 deletions
|
@ -27,6 +27,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.google.gson.Gson;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
public class ChipmunkMod implements ModInitializer {
|
||||
// This logger is used to write text to the console and the log file.
|
||||
|
@ -88,7 +89,7 @@ public class ChipmunkMod implements ModInitializer {
|
|||
}
|
||||
|
||||
InputStream is = new FileInputStream(file);
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF8")));
|
||||
|
||||
return gson.fromJson(reader, Configuration.class);
|
||||
}
|
||||
|
@ -96,7 +97,7 @@ public class ChipmunkMod implements ModInitializer {
|
|||
public static void saveConfig() throws IOException {
|
||||
Gson otherGson = new GsonBuilder().serializeNulls().setLenient().setPrettyPrinting().create();
|
||||
String defaultConfig = otherGson.toJson(CONFIG);
|
||||
BufferedWriter configWriter = new BufferedWriter(new FileWriter(CONFIG_FILE));
|
||||
BufferedWriter configWriter = new BufferedWriter(new FileWriter(CONFIG_FILE, Charset.forName("UTF8")));
|
||||
configWriter.write(defaultConfig);
|
||||
configWriter.close();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue