Information
- OS: Windows 11
- Version: 25H2
- Terminal: Powershell 7.5.4 on Windows Terminal 1.23.12811.0
- Spectre.Console 0.51.1
Describe the bug
I've been playing with Spectre.Console on and off for the last three months and I couldn't figure out why a lot of the features look quite basic compared to the example screenshots. Emojis wont work at all, even though just writing those out with Console.WriteLine works fine.
Today I added the following line at the start of my program:
Console.OutputEncoding = Encoding.UTF8;
And all of a sudden everything works. Is this line missing in the quickstart on https://spectreconsole.net/quick-start? Or is this a bug where Spectre.Console doesn't detect the correct output encoding? I assume setting the output encoding to UTF8 might also cause problems when mixing some strings contain UTF16 characters, as that is the default C# string type.
To Reproduce
Steps to reproduce the behavior.
private static void Main(string[] args)
{
AnsiConsole.MarkupLine("Hello :globe_showing_europe_africa:!");
}
Will render ??! instead of the globe emojii.
Additional context
This does work:
private static void Main(string[] args)
{
Console.OutputEncoding = Encoding.UTF8;
AnsiConsole.MarkupLine("Hello :globe_showing_europe_africa:!");
}
Information
Describe the bug
I've been playing with Spectre.Console on and off for the last three months and I couldn't figure out why a lot of the features look quite basic compared to the example screenshots. Emojis wont work at all, even though just writing those out with Console.WriteLine works fine.
Today I added the following line at the start of my program:
And all of a sudden everything works. Is this line missing in the quickstart on https://spectreconsole.net/quick-start? Or is this a bug where Spectre.Console doesn't detect the correct output encoding? I assume setting the output encoding to UTF8 might also cause problems when mixing some strings contain UTF16 characters, as that is the default C# string type.
To Reproduce
Steps to reproduce the behavior.
Will render
??!instead of the globe emojii.Additional context
This does work:
private static void Main(string[] args)
{
Console.OutputEncoding = Encoding.UTF8;
AnsiConsole.MarkupLine("Hello :globe_showing_europe_africa:!");
}