Open serhiy-storchaka opened 1 month ago
@kulikjak, could you also show the output of the above code on Solaris?
Sure, here's the output:
ja_JP.PCK +:2:2020/01/01:+*:令和:%EC%Ey年;+:1:2019/05/01:2019/12/31:令和:%EC元年;+:2:1990/01/01:2019/04/30:平成:%EC%Ey年;+:1:1989/01/08:1989/12/31:平成:%EC元年;+:2:1927/01/01:1989/01/07:昭和:%EC%Ey年
ja_JP.UTF-8 +:2:2020/01/01:+*:令和:%EC%Ey年;+:1:2019/05/01:2019/12/31:令和:%EC元年;+:2:1990/01/01:2019/04/30:平成:%EC%Ey年;+:1:1989/01/08:1989/12/31:平成:%EC元年;+:2:1927/01/01:1989/01/07:昭和:%EC%Ey年
ja_JP.eucJP +:2:2020/01/01:+*:令和:%EC%Ey年;+:1:2019/05/01:2019/12/31:令和:%EC元年;+:2:1990/01/01:2019/04/30:平成:%EC%Ey年;+:1:1989/01/08:1989/12/31:平成:%EC元年;+:2:1927/01/01:1989/01/07:昭和:%EC%Ey年
th_TH.TIS620 +:0:-543/01/01:+*::พ.ศ. %Ey
zh_CN.GB18030 +:0:0000/01/01:+*:公元:%EC%Ey年;+:1:-0001/12/31:-*:公元前:%EC%Ey年
(sorry I didn't notice this yesterday)
Bug report
It is broken in the same way as
locale.nl_langinfo(locale.ALT_DIGITS)
was broken (see #124969), although not to the same degree. It returns the last (current) era.Output:
The result is not completely useless, as it can be used to format and parse the current dates. But dates before the start of the current era (it is 2020 in Japan) cannot be proceeded.
The result should be a tuple, containing information for all eras, but this is a breaking change. So, perhaps such change cannot be backported.
cc @methane