mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 09:07:48 -04:00
Fix: Special unicode chars breaking on controls.
Turns out UTF 8 was not always enforced
This commit is contained in:
parent
843e13bd6b
commit
dfc36ab2b2
@ -5,18 +5,23 @@ import com.google.gson.JsonSyntaxException;
|
|||||||
import net.kdt.pojavlaunch.LwjglGlfwKeycode;
|
import net.kdt.pojavlaunch.LwjglGlfwKeycode;
|
||||||
import net.kdt.pojavlaunch.Tools;
|
import net.kdt.pojavlaunch.Tools;
|
||||||
|
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.lwjgl.glfw.CallbackBridge;
|
import org.lwjgl.glfw.CallbackBridge;
|
||||||
|
|
||||||
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class LayoutConverter {
|
public class LayoutConverter {
|
||||||
public static boolean convertLookType = false; //false = flat; true = classic
|
public static boolean convertLookType = false; //false = flat; true = classic
|
||||||
public static CustomControls loadAndConvertIfNecessary(String jsonPath) throws IOException, JsonSyntaxException {
|
public static CustomControls loadAndConvertIfNecessary(String jsonPath) throws IOException, JsonSyntaxException {
|
||||||
String jsonLayoutData = Tools.read(jsonPath);
|
|
||||||
|
String jsonLayoutData = IOUtils.toString(new InputStreamReader(new FileInputStream(jsonPath), StandardCharsets.UTF_8));
|
||||||
try {
|
try {
|
||||||
JSONObject layoutJobj = new JSONObject(jsonLayoutData);
|
JSONObject layoutJobj = new JSONObject(jsonLayoutData);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user