[Bug time/18666] Add support for '%OY' in strftime(), currently only "%Oy" is supported

digitalfreak at lingonborough dot com sourceware-bugzilla@sourceware.org
Fri Dec 22 00:43:00 GMT 2017


https://sourceware.org/bugzilla/show_bug.cgi?id=18666

Rafal Luzynski <digitalfreak at lingonborough dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |digitalfreak@lingonborough.
                   |                            |com

--- Comment #2 from Rafal Luzynski <digitalfreak at lingonborough dot com> ---
I don't mind adding a support of "%OY". But the root reason is that alt_digits
array in nl_langinfo() can contain only up to 100 elements. Are we able to
construct a 4-digit number like 2017 using these characters? Currently only 7
locales use alt_digits: az_IR, fa_IR, ja_JP, lzh_TW, my_MM, or_IN, shn_MM.
(Please ignore uk_UA, it will be removed very soon.) Can we safely assume these
alternative systems are decimal? It seems that yes. Can we safely assume that
"2017" is a concatenation of "2" + "0" + "1" + "7"? Seems like it's true for
om_IN but false for fa_IR. Because om_IN contains digits like "0", "1", "2",
"3", "4", "5", "6", "7", "8", "9", "10", "11",… while fa_IR contains digits
like "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11",…
What about "20" + "17"? Seems like it's true for both om_IN and fa_IR. What
about 2007, is it "20" + "07" or rather "20" + "7"? Seems like it's correct in
fa_IR but not om_IN.

ja_JP and lzh_TW seem to be even more cryptic to me, it looks like they have
separate symbols for "10", "20", "30" etc. which are not combinations of "1" +
"0", "2" + "0" etc. I'm afraid that the numbers like "2000" or "1990" cannot be
constructed with the characters currently present in their locale data.

So before we start supporting %OY we must define what is the content of
alt_digits array (should a leading zero precede the numbers from 0 to 9 or not)
and how to handle the systems which have more than 10 digits, like (probably)
ja_JP and lzh_TW.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list