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

Assign width 1 to control characters #45

Merged
merged 1 commit into from
May 9, 2024

Conversation

Jules-Bertholet
Copy link
Contributor

Unicode says the following:

control characters are not given the Default_Ignorable_Code_Point property. To avoid security problems, such characters [...], when not interpreted and not displayable by normal rendering, should be displayed in fallback rendering with a fallback glyph, so that there is a visible indication of their presence in the text.

In addition, U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR are assigned width 1, which is inconsistent with assigning width 0 to \n.

The single-character width functions continue to return None for control characters (and now do so for \0 as well). The sequence \r\n is assigned total width 1.

@Manishearth Manishearth merged commit 3063422 into unicode-rs:master May 9, 2024
2 checks passed
@Jules-Bertholet Jules-Bertholet deleted the control branch May 9, 2024 18:06
@Manishearth Manishearth mentioned this pull request Jun 6, 2024
Aetf added a commit to Aetf/unicode-truncate that referenced this pull request Jun 24, 2024
This is consistent with how unicode-width handles string width vs char
width.

See also unicode-rs/unicode-width#45
Aetf added a commit to Aetf/unicode-truncate that referenced this pull request Jun 24, 2024
This is consistent with how unicode-width handles string width vs char
width.

See also unicode-rs/unicode-width#45
Aetf added a commit to Aetf/unicode-truncate that referenced this pull request Jun 24, 2024
This is consistent with how unicode-width handles string width vs char
width.

See also unicode-rs/unicode-width#45
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.

2 participants