projects
/
Mograsim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
58c2b67
)
MicroInstructionMemoryParser and MainMemoryParser now use UTF-8
author
Daniel Kirschten
<daniel.kirschten@gmx.de>
Wed, 30 Oct 2019 21:21:58 +0000
(22:21 +0100)
committer
Daniel Kirschten
<daniel.kirschten@gmx.de>
Wed, 30 Oct 2019 21:21:58 +0000
(22:21 +0100)
plugins/net.mograsim.machine/src/net/mograsim/machine/mi/MicroInstructionMemoryParser.java
patch
|
blob
|
history
plugins/net.mograsim.machine/src/net/mograsim/machine/standard/memory/MainMemoryParser.java
patch
|
blob
|
history
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
a141a86
..
3cf971a
100644
(file)
--- 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.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;
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
{
*/
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();
{
MicroInstructionMemoryDefinition def = memory.getDefinition();
MicroInstructionDefinition miDef = def.getMicroInstructionDefinition();
@@
-129,7
+130,8
@@
public class MicroInstructionMemoryParser
int val = instStream.read();
if (val == -1 && instIndex <= maxAddress)
{
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;
val = instStream.read();
}
return val;
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
d52efdc
..
c3b0d68
100644
(file)
--- 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.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;
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
{
*/
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();
{
MainMemoryDefinition def = memory.getDefinition();
@@
-86,7
+87,8
@@
public class MainMemoryParser
int val = instStream.read();
if (val == -1 && instIndex <= maxAddress)
{
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;
val = instStream.read();
}
return val;