[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: printf doesn't work properly for non-ASCII



On 11.III.2004 at  7:48 Denis Barbier wrote:
> 
> If you want to print aligned data, you should be aware that not all
> characters fit on a cell, some are 0 or 2 column wide; see strwidth
> function in cdebconf/src/strutl.c or libtextwrap1.

I am aware, but printf must be aware too.  At present it considers the
width of all strings to be equal to the number of bytes in the string.
This is not true because 1. as you pointed some CJK symbols are two
columns wide and 2. all non-ASCII symbols are more than 1 byte long.

> I do not know if a program exists to do what you want from a shell.

OK, I will try do make such a program.

Anton Zinoviev



Reply to: