Skip to content

Fix emoji rendering in MINGW64 terminals#8

Merged
fuseraft merged 2 commits into
fuseraft:mainfrom
nightt5879:nightt5879/fix-mingw64-utf8-console
May 11, 2026
Merged

Fix emoji rendering in MINGW64 terminals#8
fuseraft merged 2 commits into
fuseraft:mainfrom
nightt5879:nightt5879/fix-mingw64-utf8-console

Conversation

@nightt5879
Copy link
Copy Markdown
Contributor

Closes #7

Summary

  • Configure Windows console input/output encoding to UTF-8 at CLI startup.
  • Keep the encoding setup best-effort so unsupported console environments do not block startup.

Verification

  • dotnet test (461 passed; existing CS8669 nullable warning in src/Cli/Commands/InitTemplates.Designer.cs)
  • dotnet run --project src\FuseraftCli.csproj -- --version

@fuseraft
Copy link
Copy Markdown
Owner

This is good. Please remove the Windows-only guard and rename ConfigureWindowsConsoleEncoding to ConfigureConsoleEncoding. TrySetConsoleEncoding adds too much cognitive overhead.

Something like this would work nicely:

static void ConfigureConsoleEncoding()
{
    try { Console.OutputEncoding = Encoding.UTF8; }
    catch (Exception e) when (e is IOException or NotSupportedException or UnauthorizedAccessException) { }
  
    try { Console.InputEncoding = Encoding.UTF8; }
    catch (Exception e) when (e is IOException or NotSupportedException or UnauthorizedAccessException) { }
}

@nightt5879
Copy link
Copy Markdown
Contributor Author

nightt5879 commented May 11, 2026

Addressed in baee77f: removed the Windows-only guard, renamed ConfigureWindowsConsoleEncoding to ConfigureConsoleEncoding, and inlined the guarded input/output UTF-8 encoding setters. Verified with dotnet test fuseraft.sln.

@fuseraft fuseraft marked this pull request as ready for review May 11, 2026 01:52
@fuseraft fuseraft merged commit f983ee7 into fuseraft:main May 11, 2026
3 checks passed
@fuseraft
Copy link
Copy Markdown
Owner

Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix emoji rendering in MINGW64 terminals.

2 participants