-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.1.6
-
sparc
-
solaris_2.5.1
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2017469 | 1.2.0 | Richard Gillam | P3 | Resolved | Fixed | 1.2beta3 |
Name: laC46010 Date: 10/19/97
Methods NumberFormat.getCurrencyInstance creates wrong format for ja_JP
(Japanese-Japan) localization.
This format returns the pattern "¥#,##0" instead of "\u5186#,##0".
^----\u00a5
As result JDK1.2 fails to pass the following JCK1.2 test case:
api/java_util/localeData/coreLocale.html#ja_JP
The contradiction comes from the source where
"yen" character is used in "currency pattern" but
"\u5186" is used as a "local currency symbol".
In all others locales identical characters are used
in these places.
See src/share/classes/java/text/resources/LocaleElements_ja.java
"¥#,##0", /*currency pattern*/
...
",", /*group (thousands) separator*/
...
"0", /*native 0 digit*/
"#", /*pattern digit*/
"-", /*minus sign*/
"E", /*exponential*/
"\u5186", /*local currency symbol*/
...
".", /*monetary decimal separator*/
An example below produces the following output:
--------------output----------------
failed: return: ¥#,##0 instead \u5186#,##0
--------------JA_JP_fails.java--------------------
import java.util.Locale;
import java.text.NumberFormat;
import java.text.DecimalFormat;
class JA_JP_fails {
public static void main(String argv[]) {
Locale ja = new Locale("ja", "JP");
NumberFormat nf = NumberFormat.getCurrencyInstance(ja);
DecimalFormat df = (DecimalFormat)nf;
if ( df.toLocalizedPattern().equals("\u5186#,##0")) {
System.out.println("OK");
} else {
System.out.println("failed: return: "+
df.toLocalizedPattern() + " instead " +
"\\u5186#,##0");
}
}
}
---------------------------------------------------------
======================================================================
- backported by
-
JDK-2017469 different currency symbols in ja_JP (Japanese-Japan) localization
- Resolved