Re: utf8 in rs

2015-11-14 Thread Ted Unangst
Ingo Schwarze wrote: > I think that way we can actually start committing such patches and > improve our userland. > > Two final notes: > > 1. It turns out each of the three programs needs exactly one > multibyte-character helper function in utf8.c, and each helper > function uses mbtowc(

Re: utf8 in rs

2015-11-14 Thread Ingo Schwarze
Hi, Christian Weisgerber wrote on Fri, Oct 23, 2015 at 03:52:31PM +0200: > Ted Unangst: >> I'm very scared to try counting chars vs bytes upfront in such code. Actually, that turns out to be simple. > I think that's insufficient to cover rs's functionality. -z will > overestimate the required

Re: utf8 in rs

2015-10-23 Thread Christian Weisgerber
Ted Unangst: > I'm very scared to try counting chars vs bytes upfront in such code. However, > the code that prints spaces to pad the output is much simpler. I think that's insufficient to cover rs's functionality. -z will overestimate the required widths and... yes, -j is completely broken. --

utf8 in rs

2015-10-23 Thread Ted Unangst
rs doesn't print nicely aligned columns with utf-8 inputs. there's a few ways to handle this; here's just one. note that the source is riddled with lots of code like: if (maxlen < p - *ep) /* update maxlen */ maxlen = p - *ep; I'm very scared to try count