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=cc800d982ab9fe3e7d026655847a2160e34a5f8e;hp=a141a86a23254bc869eaf92b39592130cf617ed7;hpb=8cf76fc41d126c7d347d080e4a941d5527d7aba5;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 a141a86a..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(); @@ -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;