mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
Clean up Reader/Writer handling to use a specified charset (#4872)
This commit is contained in:
1 parent
d0566ebadc
commit
97a2143fc2
7 files changed
+29
-23
No files matched your search
@@ -24,12 +24,17 @@ import static org.lwjgl.opengl.GL12.*;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.lang.Thread.UncaughtExceptionHandler;
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Iterator;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.Semaphore;
|
||||
@@ -149,7 +154,7 @@ public class SplashProgress
|
||||
parent.mkdirs();
|
||||
|
||||
config = new Properties();
|
||||
try (FileReader r = new FileReader(configFile))
|
||||
try (Reader r = new InputStreamReader(new FileInputStream(configFile), StandardCharsets.UTF_8))
|
||||
{
|
||||
config.load(r);
|
||||
}
|
||||
@@ -184,7 +189,7 @@ public class SplashProgress
|
||||
|
||||
File miscPackFile = new File(Minecraft.getMinecraft().mcDataDir, getString("resourcePackPath", "resources"));
|
||||
|
||||
try (FileWriter w = new FileWriter(configFile))
|
||||
try (Writer w = new OutputStreamWriter(new FileOutputStream(configFile), StandardCharsets.UTF_8))
|
||||
{
|
||||
config.store(w, "Splash screen properties");
|
||||
}
|
||||
@@ -707,7 +712,7 @@ public class SplashProgress
|
||||
enabled = false;
|
||||
config.setProperty("enabled", "false");
|
||||
|
||||
try (FileWriter w = new FileWriter(configFile))
|
||||
try (Writer w = new OutputStreamWriter(new FileOutputStream(configFile), StandardCharsets.UTF_8))
|
||||
{
|
||||
config.store(w, "Splash screen properties");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user