I'm having trouble running this code. I have a file Program.cs
with the following line
Console.WriteLine("\u280B"); // Braile dots: ⠋
I'm on Windows 10 running .NET 7 in PowerShell Core. When I dotnet run
it, it just outputs ?
. If I change the encoding to UTF8 I get a box with a question mark (if I copy it here, it shows the real icon). I'm just trying to create a little spinner à la node.js
. I also cannot print a character like "℃"
, but I can print special characters like "âäçàî"
.
I have tried the following, mostly from from this answer:
- Setting
Console.OutputEncoding
toUTF8
(andUnicode
and every other value) - Changing my console Font (JetBrains Mono, Consolas - these fonts render the correct unicode character in the IDE
- Using the string literal instead of the unicode escape
- Using
cmd.exe
andgit bash
instead ofpwsh
- Running the
.exe
instead ofdotnet run
When I run this on an online compiler like .NET Fiddle it works.