[Rd] Character Column-width Calculations

brodie gaslam brod|e@g@@|@m @end|ng |rom y@hoo@com
Sun May 3 21:51:39 CEST 2020


I just submitted a patch on bugzilla[1] to update the internal column-width tables to a more recent version of Unicode.  The most obvious way this shows up is with emoji now having a computed width of 2 columns instead of 1 once the patch is applied:

> nchar('\U0001F600', type='width'). # grinning face emoji
[1] 2 

This wasn't really an issue for a long time as many terminals didn't even do this properly either, but over the last couple of years it seems as if terminals have started to update their width tables.

I don't personally care much for emoji, but do like my wrapped-text columns to be nice and even, which is why I'm proposing the patch.  Posting here in case others are interested in the issue.

This doesn't do any grapheme computations so it won't work with combining emoji, but should still be a step in the right direction.

Best,

Brodie

[1]: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17781



More information about the R-devel mailing list