2

I've coded a simple Red "Hello world" program in Sublime Text 3:

Red []

print "Hello world!"

I've also created a build system that I'm trying to use to compile and run the program, where G:\Red Programming Language\redlang.exe is the Red programming language compiler that I downloaded from the Windows link here:

{
    "shell_cmd": "\"G:\\Red Programming Language\\redlang\" \"$file\""
}

The problem is that whenever I use my build system on a saved program, a strange NUL character appears between each character of the build output:

Screenshot

This doesn't happen with any other build system I have installed. The output appears fine if I run the redlang.exe from the Command Prompt, so it's probably an issue with my Sublime Text setup; I'm using Sublime Text Build 3083 and Windows 10. How can I get rid of those NUL characters?

Aaron Christiansen
  • 11,584
  • 5
  • 52
  • 78

1 Answers1

3

The output of Red programs on Windows is using the native UTF-16LE encoding, which is the cause of the NUL characters you are seeing, as Sublime's output capturing defaults to UTF-8. You need to change it in your build system using the encoding command as described in the Sublime build system documentation.

So you might try something like:

{
    "shell_cmd": "\"G:\\Red Programming Language\\redlang\" \"$file\"",
    "encoding": "UTF-16LE"
}

See the supported encodings list here. Hope this helps.

DocKimbel
  • 3,127
  • 16
  • 27