hykilpikonna / hyfetch

🏳️‍🌈 🏳️‍⚧️ Neofetch with LGBTQ+ pride flags!
MIT License
1.15k stars 90 forks source link

Support unicode ascii art on Windows #294

Closed luna-1024 closed 1 month ago

luna-1024 commented 1 month ago

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:

For each system on the following backends:

Additional context

None.

hykilpikonna commented 1 month ago

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