How to update the ICU data
==========================

The build script is a handy tool to generate or update the ICU data that ships
with Symfony2. You can pass the desired ICU version to build and the path to
the ICU binaries. Both arguments are optional, if not provided, the script will
try to build the latest available ICU data using the binaries available in the
environment path:

   $ php build-data.php 49
   $ php build-data.php 49 /path/to/icu/bin

It is recommended to use the ICU binaries in the same version of the desired
version to build the data files.

You can use one of the versions available in the `icu.ini` file. To update to
a newer version, just update the SVN URL for the desired release URL. For each
major ICU release, try to use the latest release tag available.

The script requires `svn` (used to download the ICU data) and the `genrb` and
`icu-config` ICU binaries. The PHP needs the extensions iconv and intl enabled.
It is recommended to use a PHP with the same intl/ICU version as the target
ICU version to build the data.

.dat-package
------------

The individual *.res files can be combined into a single .dat-file.
Unfortunately, PHP's `ResourceBundle` class is currently not able to handle
.dat-files.

Once it is, the following steps have to be followed to build the .dat-file:

3. Package the resource bundles into a single file

   $ find . -name *.res | sed -e "s/\.\///g" > packagelist.txt
   $ pkgdata -p region -T build -d . packagelist.txt

4. Clean up

   $ rm -rf build packagelist.txt

5. You can now move region.dat to replace the version bundled with Symfony2.
