Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support unicode ascii art on Windows #294

Merged
merged 1 commit into from
May 24, 2024

Conversation

luna-1024
Copy link
Contributor

@luna-1024 luna-1024 commented May 22, 2024

Description

Support unicode ascii art on Windows properly on all backends (only works on qwqfetch before this fix). This is useful since Windows Terminal can output/render UTF-8 characters. Configuration related to UTF-8 might be needed on Windows 10, though for me it works without changing any setting.

Very limited new circumstances for "garbled" output

After this change: When a Windows is in raw Powershell/cmd (not Windows Terminal), and happens to be intentionally using custom ascii art with unicode charaters, the neofetch (builtin) and fastfetch backends (in addition to it already being possible on qwqfetch) will output unicode replacement characters / tofu or otherwise not render the ascii art correctly.

This is probably a more desirable outcome than hitting an uncaught Python error. I think it is reasonable for a user who is customizing their config to this degree to be expected to set the shell encoding settings or system settings to match the output of the *fetch backend. The responsibility already applies for the user when directly using the backend with such custom ascii art.

Relevant Links

Fixes #293

Screenshots

Before: See issue.
After:
image
(this specific ascii art is set for testing, not likely to actually be used on Windows)

Testing

Verified unicode is output is properly rendered on the following systems:

  • Windows 11 Pro, 23H2, with Windows Terminal Version: 1.17.11461.0, with PowerShell and cmd prompts
  • Windows 10 Pro, 21H1, with Windows Terminal Version: 1.19.11213.0, with PowerShell prompt
  • Ubuntu 23.10, KDE Plasma 5, Konsole 23.08.1 (Linux not affected by bug)

For each system on the following backends:

  • neofetch (builtin)
  • fastfetch 2.13.1 (fastfetch-old does not support Windows)
  • qwqfetch [f72d222] (not afftected by bug)

Additional context

None.

Windows Terminal can output UTF-8 characters. Configuration may be needed on Windows 10.
@hykilpikonna hykilpikonna merged commit 109d7d2 into hykilpikonna:master May 24, 2024
@hykilpikonna
Copy link
Owner

Thanks! Surprised that the default encoding on Windows is still not utf-8 now in 2024 :o

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.

Cannot render ascii art with certain unicode characters on Windows
2 participants