mpv icon indicating copy to clipboard operation
mpv copied to clipboard

msg: consider the width of wide unicode characters

Open guidocella opened this issue 1 year ago • 3 comments

Integrating wcwidth from https://github.com/rmyorston/busybox-w32/blob/master/libbb/wcwidth_alt.c allows clearing the correct number of lines when they wrap because of characters that span 2 cells. It can also be exposed to scripts later.

We considered using the system wcwidth only on Unix, but it only works if you set a locale.

guidocella avatar Jun 29 '24 12:06 guidocella

Honestly this very much looks like a "not worth it" situation to me.

sfan5 avatar Aug 08 '24 09:08 sfan5

Honestly this very much looks like a "not worth it" situation to me.

+1

avih avatar Aug 08 '24 10:08 avih

Superseded by #14894.

guidocella avatar Sep 26 '24 15:09 guidocella

Superseded by https://github.com/mpv-player/mpv/pull/14894.

To complement on that. The new PR https://github.com/mpv-player/mpv/pull/14894 is filling the gaps that were missing in this one:

  • Accessible script to generate the code directly and be able to update it by ourselves, instead using pregenerated one
  • Implement tires for unicode codepoints lookup
  • Improves classification of more complex grapheme clusters, the new algorithm is following UAX #29

I'm open for other proposals in form of fully featured PR that are better.

kasper93 avatar Sep 26 '24 15:09 kasper93