Re: [dev] [PATCH] [sbase] Use utflen in cols(1)
On 12/5/14, Brandon Mulcahy <brandon_AT_jangler.info> wrote:
> On Fri, Dec 05, 2014 at 10:39:49PM +0000, Dimitris Papastamos wrote:
>> On Fri, Dec 05, 2014 at 02:18:03PM -0800, Robert Ransom wrote:
>> > On 12/5/14, Brandon Mulcahy <brandon_AT_jangler.info> wrote:
>> > > -It does not handle non-ASCII UTF-8 runes
>> > > -or TAB characters correctly.
>> > > +It does not handle TAB characters correctly.
>> >
>> > utflen returns the number of runes in a string, not the number of
>> > character cells that will be used to display it on a terminal.
>>
>> Hm... yes.
>
> True, but that deficiency isn't unique to the treatment of UTF-8.
It can't happen with non-control-character ASCII strings.
> Perhaps it should say something like: "It assumes a single-cell glyph
> for each character."
How about:
It assumes that each UTF-8 code point
occupies one character cell,
and thus mishandles TAB characters
(among others).
Robert Ransom
Received on Sat Dec 06 2014 - 00:28:29 CET
This archive was generated by hypermail 2.3.0
: Sat Dec 06 2014 - 00:36:07 CET