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

try to calculate width of UTF-8 encoded characters (backport #12066) #12182

Closed

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 10, 2025

Motivation

Nix assumes that each UTF-8 encoded character has a maximum width of 1, which can corrupt the terminal output, when wider characters are printed.

An additional header-only dependency widechar_width.h is introduced, which is basically a set of large lookup tables. I'm not sure whether the addition of the dependency is acceptable. Personally, I would have copied the lookup tables into the Nix source code.

Context

The functionality can be extended to verify UTF-8 encoded strings and to convert them to UCS-4 encoded strings.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.


This is an automatic backport of pull request #12066 done by [Mergify](https://mergify.com).

(cherry picked from commit 92e3095)
@mergify mergify bot requested a review from edolstra as a code owner January 10, 2025 09:51
@mergify mergify bot added the merge-queue label Jan 10, 2025
@Mic92
Copy link
Member

Mic92 commented Jan 11, 2025

Fails because our makefile doesn't include the necessary changes.

@roberth
Copy link
Member

roberth commented Jan 12, 2025

Might not be worth the effort then to solve a cosmetic issue for the duration of 6 months.

@roberth roberth closed this Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants