blob: f755507a95c4e1ba07e2ad9b8bf3e27cbca99524 [file] [log] [blame]
* Copyright (C) 2012-2013, International Business Machines Corporation and *
* others. All Rights Reserved. *
This directory contains a tool used for maintaining ICU's ISO 4217 currency
code mapping data. ICU uses a resource generated by this tool for mapping
ISO 4217 currency alpha codes to numeric codes.
package - The tool's entry point - The mapping data used by ICU - ISO 4217 XML data parser - ISO 4217 XML data entry
[Details] has String[][] CODE_MAP_DATA.
This array represents mappings between ISO 4217 alpha codes and
numeric codes. ICU's resource bundle currencyNumericCodes is generated
from the table.
ISO 4217 maintenance agency - SIX Interbank Clearing distributes
ISO 4217 code data in XML format. These files are found in There are two
files that we're interested in.
Table A.1 contains current currencies and funds and Table A.3 contains
historic denominations.
The tool supports 2 commands - check / resource.
1) check
This command compares the hardcoded mapping data in
with the ISO 4217 XML data files side by side and check differences.
2) resource
This command writes out the hardcoded mapping data in
in ICU resource bundle source format - currencyNumericCodes.txt.
[Release Tasks]
For each ICU release, we should check if the mapping data is up to date.
Prerequisites: Java 6+, ant
First, run the ant target "check". This ant target download XML files from
the SIX Interbank Clearing site and invoke the tool command "check".
When the target successfully finished, you should see the log like below:
C:\devtls\trunk\currency>ant check
Buildfile: C:\devtls\trunk\currency\build.xml
[echo] Downloading ISO 4217 XML data files
[get] Getting:
[get] To: C:\devtls\trunk\currency\out\xml\dl_iso_table_a1.xml
[get] Getting:
[get] To: C:\devtls\trunk\currency\out\xml\dl_iso_tables_a3.xml
[java] [OK] ICU data is synchronized with the reference data
Total time: 2 seconds
In this case, our data is synchronized with the latest XML data and you're done.
If the data is out of sync, you should see message like below:
[java] Missing alpha code in ICU map [ZWR]
[java] Codes not found in the reference data: ZZZ
C:\devtls\trunk\currency\build.xml:54: Java returned: 1
In this case, you have to update the hardcoded data in NumericCodeData.
You can either edit the table in NumericCodeData manually, or run the tool
command "print" and copy the output and paste it to the table.
Once you make sure "ant check" returns no errors, run "ant resource". This
target generate out/res/currencyNumericCodes.txt. The file should go to
<icu4c>/source/data/misc directory.
Note: The default ant target does both operation. Although it creates the
ICU resource file, you do not need to replace the one in ICU4C package with
the newly generated one if "check" successfully finished.