Skip to content

Improve handling of unicode characters #3618

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

Merged
merged 3 commits into from
Jun 12, 2019
Merged

Conversation

scampi
Copy link
Contributor

@scampi scampi commented Jun 10, 2019

Close #3574
Related to #6

@topecongiro
Copy link
Contributor

LGTM.

A problem is that utils::unicode_str_width takes O(n) whereas String::len takes O(1). If we were to replace every s.len() with utils::unicode_str_width(s), then we may hit a performance issue.

One solution is to create our own string type which holds the width of the Grapheme Cluster and replace it with String, though this would require a significant amount of rewriting.

@topecongiro topecongiro merged commit 1cea171 into rust-lang:master Jun 12, 2019
@scampi scampi deleted the unicode branch June 12, 2019 19:35
@topecongiro topecongiro added this to the 1.3.1 milestone Jun 12, 2019
scampi added a commit that referenced this pull request Aug 5, 2019
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.

Inconsistent Formatting with non-ASCII characters
2 participants