[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gcal] Display length of non-ASCII
From: |
Göran Uddeborg |
Subject: |
Re: [Bug-gcal] Display length of non-ASCII |
Date: |
Sun, 12 Jun 2016 23:49:35 +0200 |
In case it is of any help, I found out that these "sprintf" calls can
not simply be replaced with u8_sprintf. They need to be replaced with
u8_u8_sprintf since the format string may contain non-ASCII. With the
below patch, I get the header back over the holiday list. (Obviously,
this code only support the Unicode case. I include it just to show
what I mean, not as a ready-for-merge patch.)
--- src/hd-use.c.orig 2015-05-20 12:52:31.000000000 +0200
+++ src/hd-use.c 2016-06-12 23:46:41.000000000 +0200
@@ -1975,22 +1975,22 @@
if (use_year_zeroleaded)
{
if (is_leap_year)
- sprintf (s1, _("%s:%*sThe year %0*d is A leap year"),
+ u8_u8_sprintf (s1, _("%s:%*sThe year %0*d is A leap year"),
_("Eternal holiday list"), LEN_HD_NAME - i + 2,
"", lym, n);
else
- sprintf (s1, _("%s:%*sThe year %0*d is NO leap year"),
+ u8_u8_sprintf (s1, _("%s:%*sThe year %0*d is NO leap year"),
_("Eternal holiday list"), LEN_HD_NAME - i + 2,
"", lym, n);
}
else
{
if (is_leap_year)
- sprintf (s1, _("%s:%*sThe year %d is A leap year"),
+ u8_u8_sprintf (s1, _("%s:%*sThe year %d is A leap year"),
_("Eternal holiday list"), LEN_HD_NAME - i + 2,
"", n);
else
- sprintf (s1, _("%s:%*sThe year %d is NO leap year"),
+ u8_u8_sprintf (s1, _("%s:%*sThe year %d is NO leap year"),
_("Eternal holiday list"), LEN_HD_NAME - i + 2,
"", n);
}