blob: da6f7eba0b9d4ce5475ae717b1b57929b7c14cb4 [file] [log] [blame]
* © 2016 and later: Unicode, Inc. and others.
* License & terms of use:
* 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:
Buildfile: C:\devtools\trunk\currency\build.xml
[echo] Downloading ISO 4217 XML data files
[get] Getting:
[get] To: C:\devtools\trunk\currency\out\xml\list_one.xml
[get] Getting:
[get] To: C:\devtools\trunk\currency\out\xml\list_three.xml
[java] [OK] ICU data is synchronized with the reference data
[echo] ISO 4217 numeric code mapping data was successfully created in C:\de
Total time: 1 second
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:\devtools\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.