rtorrent-ps icon indicating copy to clipboard operation
rtorrent-ps copied to clipboard

Optimize name column chopping with `wcwidth`

Open pyroscope opened this issue 6 years ago • 2 comments

  • Might need configure test for wcwidth (skip that if it compiles on Precise)
  • Add to canvas rendering code
    • need to check how to easily decode UTF-8 sequences into code points
    • do a pre-check for pure ASCII, then just use substr
  • Inserting spaces or bumping the column position might also be needed
  • Find an adequate test case that causes visual defects with the existing code

See also https://github.com/rakshasa/rtorrent/issues/755

pyroscope avatar Jun 27 '18 22:06 pyroscope

Oi, didn't see this. If you want a test, look at https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms for double width examples.

q3cpma avatar Jun 28 '18 13:06 q3cpma

If you want, I made a simple tool doing the job (http://repo.or.cz/misc-tools.git/blob/HEAD:/mbcut.c). You could copy paste some of it.

q3cpma avatar Aug 13 '18 17:08 q3cpma