Non-UTF8 Encoding leads to crash

Create issue
Issue #43 wontfix
Fabian Maurer created an issue

When trying to load a script that is not UTF8, in my case ANSI, it can't load the script:

java.nio.charset.MalformedInputException: Input length = 1
    at java.nio.charset.CoderResult.throwException(Unknown Source)
    at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
    at sun.nio.cs.StreamDecoder.read(Unknown Source)
    at java.io.InputStreamReader.read(Unknown Source)
    at java.io.BufferedReader.fill(Unknown Source)
    at java.io.BufferedReader.read1(Unknown Source)
    at java.io.BufferedReader.read(Unknown Source)
    at org.antlr.v4.runtime.ANTLRInputStream.load(ANTLRInputStream.java:125)
    at org.antlr.v4.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:86)
    at org.antlr.v4.runtime.ANTLRInputStream.<init>(ANTLRInputStream.java:78)
    at mobtalker2.server.resources.RegularScriptFile.getStream(RegularScriptFile.java:35)
    at mobtalker2.server.script.InteractionScriptFactory.getPrototypesFor(InteractionScriptFactory.java:168)
    at mobtalker2.server.script.InteractionScriptFactory.createInstanceFor(InteractionScriptFactory.java:193)
    at mobtalker2.server.entity.BasicInteractionAdapter.createScriptInstance(BasicInteractionAdapter.java:110)
    at mobtalker2.server.entity.BasicInteractionAdapter.canStartInteractionWith(BasicInteractionAdapter.java:208)
    at mobtalker2.server.registry.InteractionRegistry.startInteraction(InteractionRegistry.java:276)
    at mobtalker2.server.registry.InteractionRegistry.onEntityInteractEvent(InteractionRegistry.java:408)
    at net.minecraftforge.event.ASMEventHandler_4_InteractionRegistry_onEntityInteractEvent_EntityInteractEvent.invoke(.dynamic)
    at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:39)
    at net.minecraftforge.event.EventBus.post(EventBus.java:108)

Comments (7)

  1. Chimaine

    This is more or less intended and won't change for 0.3.x at least. This may change in the future when I find a suitable solution that doesn't end in encoding hell.

  2. Log in to comment