Title: RE: [castor-dev] Castor XML DateFieldHandler does not handle locales correctly

Thanks for this David,

This does indeed sound like a problem. It wasn't the intention for this class to be locale sensitive. I'll take a look at this for the next release.

Cheers.

-----Original Message-----
From: David C. Browne [mailto:[EMAIL PROTECTED]]
Sent: 17 October 2002 18:36
To: [EMAIL PROTECTED]
Subject: [castor-dev] Castor XML DateFieldHandler does not handle
locales correctly


The pattern characters used by java.text.SimpleDateFormat are locale
specific, retrieved from java.text.DateFormatSymbols.localPatternChars.
 So while a pattern string such as "yyyy-MM-dd'T'HH:mm:ss" is perfectly
fine for a default locale such as en_US, it barfs when used with a
default locale such as ar_JO. 

There are a couple of these hard-coded patterns in
org.exolab.castor.xml.handlers.DateFieldHandler.  To fix the problem,
you either need to create a locale-based version of these pattern
strings, or pass a en_US locale (or other one where those strings work)
as the second argument to the SimpleDateFormat() constructor instead of
relying on the default locale.

Or is there some global locale issue about Castor XML that I am missing?

Thanks,
David Browne

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to