-
1. Re: Locale Problem
aguizar Dec 13, 2005 3:12 AM (in response to adurmus)It is worth noting that ISO-8859-1 is a charset, not a locale. The difference is clear in the following scenario.
You have a Linux machine and speak spanish. Then you decide to open your text editor and write some words in english. You'd expect to see the labels of UI components in spanish, but you'd be suprised if, upon saving, hellos were turned into holas. Yet you'd expect to open your file in other Linux machines, whatever the set language is, without problems, but you'd expect to see some chars messed up when you open it under Windows or Mac OS.
Capitalization is locale sensitive (as opposed to charset-sensitive). jBPM uses the locale of the VM that contains it. You can define the default locale either at startup with the user.language and user.country system properties, or at runtime by a call to java.util.Locale.setDefault().
Try running this simple program:import java.util.Locale; public class LocaleDemo { public static void main(String[] args) { Locale locale = new Locale(args[0], args[1]); System.out.println("Locale: " + locale.toString()); System.out.println("Country: " + locale.getDisplayCountry()); System.out.println("Language: " + locale.getDisplayLanguage()); } }
For command: java LocaleDemo es MX
The output is:Locale: es_MX Country: Mexico Language: Spanish
and for: java -Duser.language=es LocaleDemo en US:Locale: en_US Country: Estados Unidos Language: ingl?s