<i18n dev> RFR: 8317742: ISO Standard Date Format implementation consistency on DateTimeFormatter and String.format [v4]

Naoto Sato naoto at openjdk.org
Tue Nov 7 00:03:31 UTC 2023


On Mon, 6 Nov 2023 14:55:54 GMT, Shaojin Wen <duke at openjdk.org> wrote:

>> j.u.Formatter now prints "%tF" (iso standard date) and the result is incorrect when processing year < 0 or year > 9999
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   revert localize change

src/java.base/share/classes/java/util/Formatter.java line 4495:

> 4493:                     int year = t.get(ChronoField.YEAR);
> 4494:                     if (year < 0) {
> 4495:                         sb.append('-');

Some locales use a different code point to express negative numbers from `hyphen-minus`, such as `minus sign` (U+2212). I'd suggest getting it from `DecimalFormatSymbols.getMinusSign()`

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16033#discussion_r1384186755


More information about the i18n-dev mailing list