For example, the Chinese currency has the ISO 4217
code CNY
. Since free global trading in that currency is restricted though, there's a second 'offshore' currency equivalent, called CNH
. Wikipedia has a bit of summary of this all.
In Java 7
, there's a method for updating the set of three letter ISO 4217
codes that the JVM ships with. However, it can't be used to add a separate currency code to an existing country code: it would replace CNY
with CNH
, which is no good for my purposes.
How do I add CNH
(which is not in the ISO 4217
list) to the set of available currencies in Java 7
, without overwriting CNY
?
Put another way, how can I get multiple currency codes for a single country?
Note that this question: How do I add the new currency code to Java? was asked and answered for Java 6. But the strategy of replacing java.util.CurrencyData
doesn't work because that file no longer exists.