[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gcal] Display length of non-ASCII
From: |
Mariusz Adamski |
Subject: |
Re: [Bug-gcal] Display length of non-ASCII |
Date: |
Sun, 12 Jun 2016 18:29:28 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Sun, Jun 12, 2016 at 14:30:36 +0200, Göran Uddeborg wrote:
> Though I don't quite understand what the option is meant to do. I
> would have thought the needed change would be to use things like
> mbswidth() (from gnulib) rather than strlen() to figure out how much
> space a string would take. And that I thought would be backward
> compatible in a non-UTF-8 locale. But maybe I don't understand this.
Well, actually 6 years ago I was mainly interested with fixing alignment
in gcal and gcal -i and a simple replacement of sprintf and strlen with
their unicode equivalents seemed to do the trick, so that is what
--enable-unicode effectively does. Unfortunately, the holidays code
makes a lot of assumptions with stuff like *(*result_txt + len) = '\0',
when len is a number of characters, not bytes. It needs a serious
rethinking, in my opinion.
Regards,
Mariusz Adamski