Skip to content

Commit

Permalink
Fix for the Ink story json exploding on the UTF-8 BOM in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Interrupt committed Apr 22, 2020
1 parent ad8e9b0 commit f910d76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file added Dungeoneer/assets/levels/dialogue-test-level.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.interrupt.dungeoneer.Audio;
import com.interrupt.dungeoneer.GameApplication;
import com.interrupt.dungeoneer.game.Game;
import com.interrupt.dungeoneer.input.Actions;

public class DialogueOverlay extends MessageOverlay {

Expand Down Expand Up @@ -233,7 +232,8 @@ public void onShow() {
String fileJson = file.readString();

// Fixup some characters for Ink, will explode otherwise (https://github.com/bladecoder/blade-ink/issues/8)
fileJson = fileJson.replace('\uFEFF', ' ');
String BOM = new String("\uFEFF".getBytes("UTF-8"));
fileJson = fileJson.replace(BOM, "");

story = new Story(fileJson);
bindExternalFunctions(story);
Expand Down

0 comments on commit f910d76

Please sign in to comment.