Nasty Bug in Console.WriteLine()

  1. Create a new macOS Island Console Application using RTL and C#.
  2. Put this code into program.cs:
namespace TestApp
{
    static class Program
    {
        public static Int32 Main(string[] args)
        {
            Console.WriteLine("└── ");
            return 0;
        }
    }
}

Fire doesn’t crash but you get a never ending stream of debug messages like this:

with no way of regaining control of Fire unless you use Activity Monitor to force quit the debugserver process.

Looks like something about the "└── " string is upsetting Fire.

Replace └── with any other string and all is good.

Freaky. reproduced.

it’s not the debuggers same happens when running standalone.

It’s fine in classic Cocoa, fails on Island; all four individual characters print fine separately,

namespace ConsoleApplication;

type
  Program = class
  public

    class method Main(args: array of String): Int32;
    begin
      // add your own code here
      var x := '└── ';
      writeLn($'x {length(x)}');
      writeLn($'{ord(x[0])}');
      writeLn($'{ord(x[1])}');
      writeLn($'{ord(x[2])}');
      writeLn($'{ord(x[3])}');
      writeLn($'x {x}');
    end;

  end;

end.

Thanks, logged as bugs://84614

What a weird bug. Glad it’s not just me!

1 Like

Carlo thinks its somewhere in the UTF8 conversion that happens for outputting to the console, but TextConvert.StringToUTF8(x) is fined too… We’ll get to the bottom of it…

—marc

1 Like

I’m not by my computer at the moment (on my phone) but does '"├── " trigger the error too? I ask because these are characters used in the Linux tree command.

Yeah, same.

It’s definitely a compiler-side issue of some sort though, because it’s fine in Toffee, and it’s also file when I pass it to NSLog(). only Island’s writeLn() fails, and only for the whole combo.

Have fun debugging that one :smirk:

1 Like

bugs://84614 got closed with status fixed.

Wasn’t THAT hard; our iconv code had a bug. Grabbing latest IslandRTL will fix it.

1 Like