Hello all,
As a result, formatting dates result in strings like this:
There is a bug in the parsing of strings in DateFormatSymbols. In many locales, some strings (such as the "eras" and "ampms" string) have an additional field separator at the end, and DateFormatSymbols.getStringArray() does not handle this properly.
As a result, formatting dates result in strings like this:
Date date = new Date(118, 0, 22, 18, 20);
SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy h:mm aa");
System.out.println(df.format(date));
// Prints: 01/22/3918 6:20 PM® <-- See trailing ® character
I have created a bug report in bugzilla including a test case and proposed fix:
Best,
Guillermo Rodriguez Garcia
guille.rodriguez@xxxxxxxxx
guille.rodriguez@xxxxxxxxx