JDK-6289803 : DateFormatSymbols of Chinese locale is not suitable
  • Type: Bug
  • Component: globalization
  • Sub-Component: translation
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-06-23
  • Updated: 2008-11-12
  • Resolved: 2008-10-31
Related Reports
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

No j2ee installed

ADDITIONAL OS VERSION INFORMATION :
windows XP

A DESCRIPTION OF THE PROBLEM :
Tthe following is the actual output of getLocalPatternChar method of DateFormatSymbols with different locale.
    Locale.SIMPLIFIED_CHINESE      GanjkHmsSEDFwWxhKzZ
    Locale.CHINESE               GyMdkHmsSEDFwWahKzZ
    Locale.CHINA                   GanjkHmsSEDFwWxhKzZ

But I think the output of these three locale should be same.
All should be "GyMdkHmsSEDFwWahKzZ ".

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
yy-m-d
ACTUAL -
aa-n-j

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Locale myLocale = new Locale("zh", "CN");
SimpleDateFormat sdf;
DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT,myLocale);
sdf = new SimpleDateFormat();

try{
sdf = (SimpleDateFormat)df;
}
catch(ClassCastException ee)
{
 sdf = new SimpleDateFormat();
}
 
String format = sdf.toLocalizedPattern();
System.out.print(format);

---------- END SOURCE ----------
###@###.### 2005-06-23 09:26:04 GMT
CLDR has removed the support for localized patterns few weeks ago. Consulted this request with native chinese speakers.
Per their information they use english letters for patterns in simplified and traditional chinese.
Removing respective entry from all chinese resources, let them use those from english.

Comments
EVALUATION Please stop using localized date time format symbols. Rather use the base - english.
31-10-2008

EVALUATION Copied the evaluation by mistake written in description: CLDR has removed the support for localized patterns few weeks ago. Consulted this request with native chinese speakers. Per their information they use english letters for patterns in simplified and traditional chinese. Removing respective entry from all chinese resources, let them use those from english.
29-10-2008

EVALUATION According to the CLDR http://unicode.org/cldr/repository/common/main/zh.xml?rev=1.105&content-type=text/vnd.viewcvs-markup http://unicode.org/cldr/repository/common/main/ all chineses should have "GanjkHmsSEDFwWxhKzAeugXZvcL" This implies that the FormatData_zh.java should be modified, adding the { "DateTimePatternChars", "GanjkHmsSEDFwWxhKzZ" }, FormatData_zh_[CN|HK|SG|TW] should be modified, removing the { "DateTimePatternChars", "..."},
11-12-2007

EVALUATION "There's absolutely no way to tell from the javadoc what the meaning of localized pattern characters is, what constitutes a valid local pattern chars string, how these characters interact with SimpleDateFormat, and what setLocalPatternChars is supposed to do. Before any other action is taken on this bug, we need a complete specification of this, in the javadoc." from norbert.lindenberg. It's still the same case now. Only when there is a clear document describing the pattern specification, can we know if the pattern for zh_CN locale is correct, and how to update it if it's not correct. Changing the pattern without knowing the internal implementation may cause unexpected problem. Please refer to bug 4312282 Doc: localPatternChars description should be in DateFormat API doc This is a bug not deal with by any one for long time. I am wondering if we should raise its priorite to 3, so that there will be someone who are in charge of.
08-08-2006

EVALUATION can be changed by updating FormatData_zh_CN.java in src/share/classes/sun/text/resources
06-02-2006