-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
java.nio.charset.MalformedInputException: Input length = 1 #145
Comments
same phenomenon |
I see the same issue... |
I see this issue as well. This is when running the demo in chisel-bootcamp. |
Hi! I have solved the issue. val svgModuleText = FileUtils.getText(moduleView)
val svgInstanceText = FileUtils.getText(instanceView)
To solve the problem, we need to specify the encoding of JVM by setting the system environment variable You can examine your JVM encoding with this codes import java.io.ByteArrayOutputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
class Test {
public static void main(String[] args) {
System.out.println("Default Charset=" + Charset.defaultCharset());
System.out.println("file.encoding=" + System.getProperty("file.encoding"));
System.out.println("Default Charset=" + Charset.defaultCharset());
System.out.println("Default Charset in Use=" + getDefaultCharSet());
}
private static String getDefaultCharSet() {
OutputStreamWriter writer = new OutputStreamWriter(new ByteArrayOutputStream());
String enc = writer.getEncoding();
return enc;
}
} |
Confirm it works after doing what @ranshuo-ICer suggested: |
when i run code "visualize(() => new MovingAverage3(8))" in "0_demo.ipynb",i got a error that "dot" isn't exist.
And then i installed graphviz 2.47.0 win64 for win10.I run this command again,and got a error "java.nio.charset.MalformedInputException: Input length = 1"
detail logs:
java.nio.charset.MalformedInputException: Input length = 1
java.nio.charset.CoderResult.throwException(CoderResult.java:281)
sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
java.io.InputStreamReader.read(InputStreamReader.java:184)
java.io.BufferedReader.read1(BufferedReader.java:210)
java.io.BufferedReader.read(BufferedReader.java:286)
java.io.Reader.read(Reader.java:140)
scala.io.BufferedSource.mkString(BufferedSource.scala:98)
firrtl.FileUtils$.getText(FileUtils.scala:130)
firrtl.FileUtils$.getText(FileUtils.scala:121)
ammonite.$file.dummy.source.load$minusivy_2$Helper.generateVisualizations(Main.sc:149)
ammonite.$file.dummy.source.load$minusivy_2$Helper.visualize(Main.sc:159)
ammonite.$sess.cmd3$Helper.(cmd3.sc:1)
ammonite.$sess.cmd3$.(cmd3.sc:7)
ammonite.$sess.cmd3$.(cmd3.sc:-1)
The text was updated successfully, but these errors were encountered: