This is my first attempt at playing with currencies in Java and I'm struggling with a problem. Basically I have a page that displays a list of available currencies. This list is derived from a database table which has the currency names and ISO 4217 currency codes (i.e. USD, GBP etc). The list is created by selecting all of the currencies from this table and loading them into a list of java.util.Currency objects, where each Currency object is created like so:
I then iterate over that list calling the Currency.getSymbol() method for each currency to display the appropriate symbol for each one. The problem is that it doesn't. All that gets displayed is the currency code for each currency, except for Euros and GBP where the appropriate � or � symbol is displayed. I've read around and it appears that this is because my default Locale is set to the UK and indeed when I change the Locale to the US for example, then USD appear as $ and Euro's don't!
So what I would like to know is is it possible in java to get a currency's symbol using only a currency code and without having to change the default Locale? Or am I better off just adding another column to my database and storing symbols in there?