mattn / go-runewidth

wcwidth for golang
MIT License
608 stars 94 forks source link

Support Unicode 15.0.0 #74

Closed joelim-work closed 3 months ago

joelim-work commented 1 year ago

Update the rune tables to match Unicode 15.0.0

I suspect this kind of task will have to be done every time a new version of Unicode is released, which is roughly every year.

rhysd commented 3 months ago

Hi @mattn, I'm sorry for bothering you. But do you have any concern on merging this PR? Currently this library does not calculate a string width correctly when it contains some characters which were added in recent specs of Unicode.

mattn commented 3 months ago

Sorry I missed it. I will check this tonight.

joelim-work commented 3 months ago

Hi, it's been almost a year since I submitted this PR and I had almost forgotten about it.

So just to be clear I tried not to change anything much, just update runewidth_table.go using the following steps:

  1. Change the URLs of the source files
  2. Make minor changes to generate.go to accommodate for the new format in the source files
  3. Run go generate
  4. Change the counts/hashes in runewidth_test.go so that go test passes

Hopefully this is right.


P.S. Unicode is now up to version 15.1.0 - I have a branch for that as well if you prefer that instead.

mattn commented 3 months ago

I confirmed your 15.1.0 branch is working well. ~could you please update this pull request to the branch?~

I'll cherry-pick your commit.

mattn commented 3 months ago

Thank you.

https://github.com/mattn/go-runewidth/commit/6ceadc68530e7bfea8cba17d6523bed32912d4fa

joelim-work commented 3 months ago

@mattn Thanks!

You might want to close #56 as well, since it is out of date.

rhysd commented 3 months ago

@mattn Thank you for your quick support :pray::dog: