Compiling Resource Bundles
Resource definitions in a text file are compiled into a compact, binary form using the supplied genrb utility, located in:
*Windows
icu-root-dir\bin
*UNIX
icu-root-dir/sbin
...where icu-root-dir is the location where your ICU distribution is installed. If you are using the Rogue Wave-provided ICU distribution, see Chapter 4 in Building Your Applications for the location of those libraries.
The genrb reads text files (see Defining Resource Bundles), and outputs .res binary resource bundle files. For example:
 
genrb en_US.txt
creates the resource bundle en_US.res. The complete syntax for genrb is:
 
genrb [options] [files]
where files is a list of text files. Some of the more useful options are:
*-s followed by a path specifies the source directory for text files
*-d followed by a path specifies the destination directory for .res resource bundles
*-e followed by an encoding name specifies that strings in the text files are in the specified encoding
*-p followed by package-name prepends package-name_ to the name of the resource bundle.
NOTE: The resource bundle’s pathname is required to contain this prepended package name.
For instance, if your data path is "/usr/local/resources/myApp/" and the locale in question "en_US", ICU looks for a file named "/usr/local/resources/myapp/myApp_en_US.res".
You may use the genrb utility to update your resource filenames. To prepend the package-name "myApp_" to the resource file, simply add the argument "-p myApp" to the command line.
For a complete list of options, type genrb -h.
When you compile a resource bundle, any string data is converted from the text encoding to a Unicode format. However, to simplify the lookup process, keys are not converted to a Unicode representation, but are used exactly as encoded in the text file. Although you may use any single-byte character set for RWUResourceBundle keys, for maximum portability, it is best to limit the characters used for keys to the basic source character set described in Multilingual Text in C++. This set corresponds to the printable ASCII or Latin-1 character set.
Note that binary data, as well as keyed data, are compiled into a platform-specific form. As a result, table data may not be found on a platform where the character encoding (ASCII or EBCDIC, for instance) used for the keys is different than that where compiled. For similar reasons, binary data may be wrong if compiled on a big-endian machine and read on a little-endian machine, or vice versa.