unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Rafal Luzynski <digitalfreak@lingonborough.com>
To: Siddhesh Poyarekar <siddhesh@gotplt.org>
Cc: GLIBC Devel <libc-alpha@sourceware.org>
Subject: Re: glibc 2.29 - Winter is coming...
Date: Thu, 3 Jan 2019 01:20:45 +0100 (CET)	[thread overview]
Message-ID: <2063591203.633198.1546474845289@poczta.nazwa.pl> (raw)
In-Reply-To: <0c9a2e87-8b43-725a-d9cc-689ec032ba96@gotplt.org>

2.01.2019 19:24 Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
> 
> On 02/01/19 5:22 PM, Rafal Luzynski wrote:
> > [...]
> > [1] Cyrillic -> ASCII transliteration: I am not sure which locale should
> [...]
> However, I am acutely aware that I may not understand the gravity of 
> some of the differences and you're free to throw my opinions out the 
> window :)

Thank you, I will reply in the proper thread.

> > [2] [3] Default width for "%Ey" which is important due to the Japanese
> > era change in 4 months.  Also, this patch fixes handling of formatting
> > flags so if that helps it can be split into the patches fixing the width
> > issue and fixing the flags issue.
> 
> A more detailed explanation of what the Japanese era change entails is 
> needed in here, i.e. why is the padding needed

Each Japanese era year is the year of reign of the current emperor.
The current year is 31 (2 digits).  As soon as the new era is announced,
the new year will have the number 1 (one digit).  As far as I understood,
they do not want the year to be formatted as "1" but "01" instead because
they want to keep the constant width output for example in logs.
My reasoning is that "%y" is always zero-padded to 2 digits so for the
consistency let's set "%Ey" to be zero-padded to 2 digits as well.

The new Japanese era is already scheduled. [1]

> and what would the output 
> look like if we don't fix it in this release and why that would be a 
> problem.

For the comparison, here is the output of the current year and 1990 which
had the same problem:

$ LC_ALL=ja_JP.utf8 date +%Y
2019
$ LC_ALL=ja_JP.utf8 date +%EY
平成31年
$ LC_ALL=ja_JP.utf8 date +%Y -d "29 years ago"
1990
$ LC_ALL=ja_JP.utf8 date +%EY -d "29 years ago"
平成2年

I think they want: "平成02年".

An explanation why I use here "%Y" and "%EY" while we are talking
about "%Ey".  The reason is that "%EY" is expanded into a subformat which
may contain "%Ey" as the actual year number.

> Other than that, this seems like something we can make an exception for, 
> assuming that it does not affect translations.

It does not affect translations of glibc but does affect translations of
applications to a minor extent: the zero-padded output is one character
wider than the non-zero-padded one.  But:

* this is exactly what they want,
* the output for the current year (and 21 previous years) is already the
same wide as a zero-padded single digit year.

> I personally would have 
> done 2 different patches, but I know others in the community who would 
> have stuck this into a single patch so I don't have too strong an 
> opinion about that aspect of this patch.

The other issue is that the additional flags like "%-EY" or "%_EY" are
ignored.  I was going to say that this is not related with the era
change but actually it is: as long as the year number had 2 digits
those flags were correctly ignored.  Now the users will have a good
reason to expect them to work correctly.

Regards,

Rafal

[1] https://en.wikipedia.org/wiki/2019_Japanese_imperial_transition

  reply	other threads:[~2019-01-03  0:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02 10:28 glibc 2.29 - Winter is coming Siddhesh Poyarekar
2019-01-02 10:59 ` Florian Weimer
2019-01-02 11:29   ` Siddhesh Poyarekar
2019-01-02 11:52     ` Rafal Luzynski
2019-01-02 18:24       ` Siddhesh Poyarekar
2019-01-03  0:20         ` Rafal Luzynski [this message]
2019-01-03 14:32           ` Carlos O'Donell
2019-01-03 20:58             ` Joseph Myers
2019-01-04 21:25               ` Carlos O'Donell
2019-01-07 18:59               ` Florian Weimer
2019-01-02 13:11     ` Gabriel F. T. Gomes
2019-01-02 13:16       ` Florian Weimer
2019-01-02 13:47         ` Siddhesh Poyarekar
2019-01-02 16:02           ` Gabriel F. T. Gomes
2019-01-08 13:33 ` Szabolcs Nagy
2019-01-08 14:16   ` Carlos O'Donell
2019-01-08 14:21     ` Szabolcs Nagy
2019-01-08 16:50       ` Carlos O'Donell
2019-01-09 10:50         ` Ramana Radhakrishnan
2019-01-09 16:03           ` Carlos O'Donell
     [not found]             ` <BL0PR01MB4593D75E9376CC15EE8CA24AF7990@BL0PR01MB4593.prod.exchangelabs.com>
2019-01-23 14:07               ` Carlos O'Donell
2019-01-09  5:48       ` Siddhesh Poyarekar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2063591203.633198.1546474845289@poczta.nazwa.pl \
    --to=digitalfreak@lingonborough.com \
    --cc=libc-alpha@sourceware.org \
    --cc=siddhesh@gotplt.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).