Bug in parsing of strings in DateFormatSymbols

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

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: 

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83968

Best,

Guillermo Rodriguez Garcia
guille.rodriguez@xxxxxxxxx

[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux