X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.machine%2Fsrc%2Fnet%2Fmograsim%2Fmachine%2Fmi%2FMicroInstructionMemoryParser.java;h=3cf971a1f44e6b87a025382b152add82602d6e15;hb=f098cd47d06be0cc654532a5fad0e5e89f0ef93c;hp=b351ca7b749745354694652b55ecc069516ee3fe;hpb=38902818500a67f6a55973b9acbd4194f7a82838;p=Mograsim.git diff --git a/plugins/net.mograsim.machine/src/net/mograsim/machine/mi/MicroInstructionMemoryParser.java b/plugins/net.mograsim.machine/src/net/mograsim/machine/mi/MicroInstructionMemoryParser.java index b351ca7b..3cf971a1 100644 --- a/plugins/net.mograsim.machine/src/net/mograsim/machine/mi/MicroInstructionMemoryParser.java +++ b/plugins/net.mograsim.machine/src/net/mograsim/machine/mi/MicroInstructionMemoryParser.java @@ -6,6 +6,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import net.mograsim.machine.mi.parameters.MicroInstructionParameter; import net.mograsim.machine.mi.parameters.ParameterClassification; @@ -49,7 +50,7 @@ public class MicroInstructionMemoryParser */ public static void parseMemory(final MicroInstructionMemory memory, InputStream input) throws IOException { - try (BufferedReader reader = new BufferedReader(new InputStreamReader(input))) + try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8))) { MicroInstructionMemoryDefinition def = memory.getDefinition(); MicroInstructionDefinition miDef = def.getMicroInstructionDefinition(); @@ -99,7 +100,7 @@ public class MicroInstructionMemoryParser } catch (Exception e) { - throw new MicroInstructionMemoryParseException(e.getCause()); + throw new MicroInstructionMemoryParseException(e); } } @@ -129,7 +130,8 @@ public class MicroInstructionMemoryParser int val = instStream.read(); if (val == -1 && instIndex <= maxAddress) { - instStream = new ByteArrayInputStream((toCSV(memory.getCell(instIndex++)) + lineSeparator).getBytes()); + instStream = new ByteArrayInputStream( + (toCSV(memory.getCell(instIndex++)) + lineSeparator).getBytes(StandardCharsets.UTF_8)); val = instStream.read(); } return val;