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

Update to Unicode 15.0.0 #437

Merged
merged 2 commits into from
Jan 12, 2023
Merged

Update to Unicode 15.0.0 #437

merged 2 commits into from
Jan 12, 2023

Conversation

elfham
Copy link
Contributor

@elfham elfham commented Mar 17, 2022

Ruby core has updated UCD version based on Unicode 14.0.0.

Following this, I updated Reline's East Asian Width table to Unicode 14.0.0 based.

@nobu
Copy link
Member

nobu commented Sep 1, 2022

Could you add tests?

@elfham
Copy link
Contributor Author

elfham commented Sep 1, 2022

Sorry, I don't know what kind of testing is required...

This file was mechanically generated by the script that comes with Reline (reline/generate_east_asian_width), and it seems unlikely that the generated code would be broken if not for a bug in the script.

Also, no specific test code seems to have been created in past updates of EastAsianWidth.txt.

This also seems to be true for Ruby.

So, for this PR, I think there is little need for a test case beyond regression testing.

Or does anyone have any ideas as to what kind of testing is needed?

@elfham
Copy link
Contributor Author

elfham commented Sep 1, 2022

By the way, Unicode 15.0.0 will be released soon, making this PR obsolete...

@ima1zumi
Copy link
Member

ima1zumi commented Dec 5, 2022

@nobu As @elfham said, I think this PR does not need testing. What do you think?

@hsbt
Copy link
Member

hsbt commented Dec 12, 2022

Unicode 15.0 is already merged at ruby core. FYI https://bugs.ruby-lang.org/issues/18639

Should we use Unicode 15.0 instead of 14.0 on reline too?

@ima1zumi
Copy link
Member

@hsbt Reline's Unicode support is for character width(especially east asian width), so it must be supported separately from the Ruby core.

@hsbt
Copy link
Member

hsbt commented Dec 12, 2022

@ima1zumi I didn't say how organize them. Just what's version should we use?

@ima1zumi
Copy link
Member

@hsbt
The current reline uses Unicode 13.0.0. We should use Unicode 15.0.0 to match Ruby core.
But I think we don't have to do it right now.

If this file is not updated, the widths of characters added after Unicode 14.0.0, such as Emojis, will not be obtained correctly.
For example, the width of 🫠 added in Unicode 14.0.0 is 2.
But displayed width is 1 and it has been overwritten with a.

image

However, I do not know how to update this file at present.
I think Unicode 15.0.0 support for Reline doesn't have to do for the Ruby 3.2.0 bundled version.
Because this issue affected only the new character's width. And we don't have much time.

@hsbt
Copy link
Member

hsbt commented Dec 12, 2022

This is not rush thing. We can update this for Ruby 3.2.1 or others.

@elfham
Copy link
Contributor Author

elfham commented Dec 12, 2022

As you are discussing, I don't think many people will be troubled if Reline stays at 13.0.0.

By the way, I would like to update this PR to 15.0.0.
Is it OK to push the update to 15.0.0?

@ima1zumi
Copy link
Member

ima1zumi commented Dec 12, 2022

@elfham

Is it OK to push the update to 15.0.0?

That would be great. Thank you!

@elfham elfham changed the title Update to Unicode 14.0.0 Update to Unicode 15.0.0 Dec 12, 2022
@elfham
Copy link
Contributor Author

elfham commented Dec 12, 2022

I have updated to 15.0.0 by ba89e85 . (commit date was 3 months ago...)

@ima1zumi
Copy link
Member

ima1zumi commented Jan 3, 2023

Looks good to me 🌟
I have confirmed that following process does not produce any differences.

  1. Download http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
  2. $ bin/generate_east_asian_width EastAsianWidth.txt > lib/reline/unicode/east_asian_width.rb

My terminal (Alacritty 0.10.0-dev (8cda3d14)) is not displaying 🫢️ width correctly, but Reline::Unicode.get_mbchar_width('🫢') returns 2, so I think it is OK.
I think it may be my terminal issue.

image

@hasumikin hasumikin merged commit cab4274 into ruby:master Jan 12, 2023
matzbot pushed a commit to ruby/ruby that referenced this pull request Jan 12, 2023
(ruby/reline#437)

* Update to Unicode 14.0.0

* Update to Unicode 15.0.0
@ima1zumi ima1zumi added enhancement New feature or request dependencies Pull requests that update a dependency file and removed enhancement New feature or request labels Mar 27, 2023
@elfham elfham deleted the eaw-14.0.0 branch June 16, 2023 14:15
@elfham elfham mentioned this pull request Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Development

Successfully merging this pull request may close these issues.

5 participants