This is an archive of the discontinued LLVM Phabricator instance.

Update the list of double width codepoints
ClosedPublic

Authored by cor3ntin on Nov 22 2022, 11:32 AM.

Details

Summary

All east asian width wide and full-width codepoints
are considered double width, as well as emojis and
symbols commonely rendered as emoji.

Diff Detail

Event Timeline

cor3ntin created this revision.Nov 22 2022, 11:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 22 2022, 11:32 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
cor3ntin requested review of this revision.Nov 22 2022, 11:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 22 2022, 11:32 AM

I did that as a drive-by while investingating https://github.com/llvm/llvm-project/issues/54732#issuecomment-1324107610 (which turned out to work correctly after all)

Any ideas on how to test this?

There are some preexisting tests in llvm/unittests/Support/UnicodeTest.cpp which I might be able to extend with a sampling of unicode 15 codepoints, I don't know how meaningful that would be but as we talked before the only way to do exhaustive checking here would be to cross check to independent implementation.

cor3ntin retitled this revision from Update the list of double with codepoints to Update the list of double width codepoints.Nov 28 2022, 5:10 AM
aaron.ballman accepted this revision.Nov 28 2022, 5:27 AM

LGTM! Agreed that testing this would be somewhat meaningless without some sort of oracle we can reference. Probably should add a release note for the fix when landing?

This revision is now accepted and ready to land.Nov 28 2022, 5:27 AM

The release notes have

  • Unicode support has been updated to support Unicode 15.0.

New unicode codepoints are supported as appropriate in diagnostics,
C and C++ identifiers, and escape sequences.

That seems sufficient

This revision was landed with ongoing or failed builds.Nov 28 2022, 6:13 AM
This revision was automatically updated to reflect the committed changes.

Thanks Aaron.
As discussed offline I added a few tests anyway, it can't hurt

The tests broke the build on some windows platforms, I pushed a fix here https://reviews.llvm.org/rG9fec67483d4c
Sorry for anyone who was impacted by that