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: [PATCH v2] Improve the width of alternate representation for year in strftime [BZ #23758]


TAMUKI Shoichi wrote:
Since only one Japanese era name is used by each emperor's reign, it
is rare that the year ends in one digit or lasts more than three
digits.

Rare recently, but over the long term about 75% of Japanese imperial years have been single-digit years: since 701 AD there have been 989 single-digit years but only 329 two-digit years. (This calculation is approximate, but it's close enough; see attached shell script for how I did the calculation.) Although Japan is more stable now than it was centuries ago, the long reigns since 1868 are a historical aberration and it should not be surprising if the fraction of single-digit years reverts closer to historical levels in the not-too-distant future.

Although I'm no expert in Japanese, as I understand it the most common style for formatting imperial dates in plain text uses no spaces anywhere, e.g., "平成2年3 月4日" for Heisei 2 March 4. It's far less common to see spaces to make things line up, presumably for tables.

Since glibc is already defaulting to space padding for month and day-of-month, it makes sense for glibc to also default to space padding for imperial year. However, this change should be announced more clearly. The ChangeLog entry should say what's going on at a high level, and give an example call to strftime with the before-and-after output, along with how to generate imperial dates with no spaces; and (more important) the glibc documentation should for strftime should contain similar examples.

Attachment: era.sh
Description: application/shellscript


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