Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 May 2009 14:41:01 +0200
From:      "Ronald Klop" <ronald-freebsd8@klop.yi.org>
To:        "freebsd-java@freebsd.org" <freebsd-java@freebsd.org>
Subject:   Fwd: openjdk6 error in Locale
Message-ID:  <op.ut2qunpl8527sy@82-170-177-25.ip.telfort.nl>
In-Reply-To: <21097791.14281242121898393.JavaMail.tomcat@localhost>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Hi,

I sent this to the maintainer of the openjdk6 port, but thought it would  
be good to share it with you to?

If I run the attached programm with port java/openjdk6 (b14 and b16) I get  
this output.
displayname: Dutch
decimal: .
grouping: ,
dateformat: AD
displayname: Dutch (Netherlands)
decimal: .
grouping: ,
dateformat: AD

If I run it with port java/jdk16 I get.
displayname: Dutch
decimal: ,
grouping: .
dateformat: AD
displayname: Dutch (Netherlands)
decimal: ,
grouping: .
dateformat: AD

As you see the 'decimal' and 'grouping' are reverted. The last output is  
correct for The Netherlands.
This is all on 7.2-STABLE/amd64.

Can you reproduce the problem? And does anybody know how can I fix it?

Cheers,

Ronald.
[-- Attachment #2 --]
package nl.realworks.apps.ronald;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;

public class LocaleTest {

	public static void main(String[] args) {
		for (Locale l : new Locale[] { new Locale("nl"), new Locale("nl", "NL") }) {
			System.out.println("displayname: " + l.getDisplayName());
			DecimalFormat nf = (DecimalFormat)NumberFormat.getNumberInstance(l);
			final DecimalFormatSymbols decimalFormatSymbols = nf.getDecimalFormatSymbols();
			System.out.println("decimal: " + decimalFormatSymbols.getDecimalSeparator());
			System.out.println("grouping: " + decimalFormatSymbols.getGroupingSeparator());
		}
	}
}
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.ut2qunpl8527sy>