ProbeJS

ProbeJS

972k Downloads

`java.nio.charset.MalformedInputException: Input length = 1` error on typing generation

Mickeon opened this issue ยท 4 comments

commented

I got the following exception on a modpack that is not publicly available (as of yet):

[11:44:37] [Thread-56/ERROR] [probejs/]: Uncaught exception has occurred!
5847 | java.nio.charset.MalformedInputException: Input length = 1
5848 | at java.nio.charset.CoderResult.throwException(CoderResult.java:274) ~[?:?] {}
5849 | at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:307) ~[?:?] {}
5850 | at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282) ~[?:?] {}
5851 | at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:132) ~[?:?] {}
5852 | at java.io.OutputStreamWriter.write(OutputStreamWriter.java:205) ~[?:?] {}
5853 | at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:120) ~[?:?] {re:mixin}
5854 | at java.io.BufferedWriter.write(BufferedWriter.java:233) ~[?:?] {re:mixin}
5855 | at java.io.Writer.write(Writer.java:249) ~[?:?] {re:mixin}
5856 | at com.probejs.rich.lang.RichLangCompiler.compile(RichLangCompiler.java:74) ~[probejs-6.0.0-forge.jar%23563!/:?] {re:classloading,pl:rei_plugin_compatibilities:B}

5857 | at com.probejs.ProbeCommands.lambda$triggerDump$4(ProbeCommands.java:118) ~[probejs-6.0.0-forge.jar%23563!/:?] {re:classloading,pl:rei_plugin_compatibilities:B}
5858 | at java.lang.Thread.run(Thread.java:833) ~[?:?] {re:mixin}

Without any additional information it's very difficult to infer what the issue may even be:

The entire log is as follows:
latest.log
https://mclo.gs/ipCN9R8

commented

It looks like some keys in the language files have charsets that the default encoding (UTF-8) is not able to handle. I'll fix it after a rewrite of the major codegen.

commented

This is weird. The GSON encoded string is made of these Unicode characters even if I tried telling them to use \uXXXX instead. I'll debug it later.

ProbeJS dumps the language file by reading languages loaded in Minecraft, so they are flags in the Minecraft as loaded from \uXXXX escapes, the problem is that GSON encoded these flags as original characters (instead of escaping them), and NIO wasn't able to handle these special characters and thrown an error...

commented

Thank you for the quick response. With that clue, I was able to track it down to Create: Deepfried.
The language file is as follows: en_us.json

The mod uses special Unicode characters to display continent flags, but the JSON's keys themselves do not seem out of the ordinary, unless it's hard to spot.

commented

As of the latest ProbeJS version this issue does not happen anymore.

There's another one that stops the dumping with Illager Invasion installed, but I don't know if that has been reported yet.