X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=plugins%2Fnet.mograsim.machine%2Fsrc%2Fnet%2Fmograsim%2Fmachine%2Fstandard%2Fmemory%2FMainMemoryParser.java;h=c3b0d689dbec88f110e629e88519f41b8c87b4bb;hb=cc800d982ab9fe3e7d026655847a2160e34a5f8e;hp=d52efdcff3fc1fdc25217c72a16380c9d43d0dac;hpb=9f4b106057a7b291aa880620dc80faa9cb7fc8f3;p=Mograsim.git diff --git a/plugins/net.mograsim.machine/src/net/mograsim/machine/standard/memory/MainMemoryParser.java b/plugins/net.mograsim.machine/src/net/mograsim/machine/standard/memory/MainMemoryParser.java index d52efdcf..c3b0d689 100644 --- a/plugins/net.mograsim.machine/src/net/mograsim/machine/standard/memory/MainMemoryParser.java +++ b/plugins/net.mograsim.machine/src/net/mograsim/machine/standard/memory/MainMemoryParser.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.logic.core.types.BitVector; import net.mograsim.machine.MainMemory; @@ -50,7 +51,7 @@ public class MainMemoryParser */ public static void parseMemory(final MainMemory memory, InputStream input) throws IOException { - try (BufferedReader reader = new BufferedReader(new InputStreamReader(input))) + try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8))) { MainMemoryDefinition def = memory.getDefinition(); @@ -86,7 +87,8 @@ public class MainMemoryParser int val = instStream.read(); if (val == -1 && instIndex <= maxAddress) { - instStream = new ByteArrayInputStream((memory.getCell(instIndex++).toBitstring() + lineSeparator).getBytes()); + instStream = new ByteArrayInputStream( + (memory.getCell(instIndex++).toBitstring() + lineSeparator).getBytes(StandardCharsets.UTF_8)); val = instStream.read(); } return val;