This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes UK Locale problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "UK Locale problem" Watch "UK Locale problem" New topic
Author

UK Locale problem

Steve Wood
Ranch Hand

Joined: Jan 08, 2003
Posts: 137
Hi guys,

Our server has the following configuration:

LANG=en_GB.ISO8859-15
LC_CTYPE="en_GB"
LC_NUMERIC="en_GB"
LC_TIME="en_GB"
LC_COLLATE="en_GB"
LC_MONETARY="en_GB"
LC_MESSAGES="en_GB"
LC_ALL=en_GB

But when we call this:

Currency.getInstance(Locale.getDefault());

We get this:

java.lang.IllegalArgumentException at java.util.Currency.getInstance(Currency.java:241)

Any ideas?

Any help is much appreciated.

Cheers,

Steve
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
The Currency.getInstance() method throws a IllegalArgumentException - if the country of the given locale is not a supported ISO 3166 country code

What is the default Locale for the machine you are running?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Nothing to do with JSP, so off to the Java in General (intermediate) forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: UK Locale problem
 
Similar Threads
Stumped By HashSet
fmt:formatDate with an "en" locale formats like "en_US"
Different Locale's , same JVM
how to format the price of a product specified in Indian Rupees
Sitemesh preventing Euro symbol from displaying properly