This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][PATCH] Multiple locales: Use the correct date and time formats (bug 10496, 23724).


Hello Rafal,

From: Rafal Luzynski <digitalfreak@lingonborough.com>
Date: Sat, 3 Nov 2018 20:45:56 +0100 (CET)
Subject: Re: [RFC][PATCH] Multiple locales: Use the correct date and time formats (bug 10496, 23724).

> > > [...]
> > > @@ -303,16 +303,19 @@ mon         "janar";/
> > >  am_pm       "PD";"MD"
> > >  %
> > >  % Appropriate date and time representation
> > > -d_t_fmt     "%Y-%b-%d %I.%M.%S.%p %Z"
> > > +d_t_fmt     "%a %-d %b %Y %l:%M:%S.%p"
> > 
> > I am afraid that change will unable to keep it a constant width.
> 
> Is it required to keep the constant width?  In my native locale we use
> "%-d" and I think it works fine.

Although I am no expert in sq_AL locale, if d_t_fmt which is fixed
width suddenly becomes variable width, I just thought that there might
be people in trouble.

I have roughly checked in the current locale data to see which locale
uses a variable width at d_t_fmt.  The result is:

ca_ES:	"%A, %-d %B de %Y, %T %Z"
cs_CZ:	"%a<U00A0>%-d.<U00A0>%B<U00A0>%Y,<U00A0>%H:%M:%S<U00A0>%Z"
hu_HU:	"%Y. %b. %-e., %A, %H:%M:%S %Z"
it_CH:	"%a %-d %b %Y, %T"
it_IT:	"%a %-d %b %Y, %T"
nr_ZA:	"%a %-e %b %Y %T %Z"
pl_PL:	"%a, %-d %b %Y, %T"
ss_ZA:	"%a %-e %b %Y %T %Z"
st_ZA:	"%a %-e %b %Y %T %Z"
szl_PL:	"%a, %-d %b %Y, %T"
tn_ZA:	"%a %-e %b %Y %T %Z"
ts_ZA:	"%a %-e %b %Y %T %Z"
xh_ZA:	"%a %-e %b %Y %T %Z"

> > How about using "%a %_d %b %Y %l:%M:%S.%p" instead.
> 
> "_" means "use a space as padding".  If I had to use space padding
> I would use "%e" instead which does the same and is less tricky.

Yes, indeed.  Since "%e" and "%-d" are equivalent, one byte can be
saved by using "%e".  Thank you for your advice.

> > [...]
> > >  %
> > >  % Appropriate date representation
> > > -d_fmt       "%Y-%b-%d"
> > > +d_fmt       "%-d.%-m.%y"
> > 
> > Likewise, how about using "%_d.%_m.%y" instead.
> 
> No, additional space before a month number looks definitely bad.
> We use dots or other punctuation characters and zero padding to avoid
> spaces in a string which normally should have no spaces.

For example, "LANG=C date" shows a space as padding to keep it a
constant width.

Anyway, if people involved in that locale are not particularly
troubled, I think that there is no problem without padding.

Regards,
TAMUKI Shoichi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]