Directory |
Description |
<ICU>/source/common/ |
The core Unicode and support functionality, such as resource bundles,
character properties, locales, codepage conversion, normalization,
Unicode properties, Locale, and UnicodeString. |
<ICU>/source/i18n/ |
Modules in i18n are generally the more data-driven, that is to say
resource bundle driven, components. These deal with higher-level
internationalization issues such as formatting, collation, text break
analysis, and transliteration. |
<ICU>/source/layoutex/ |
Contains the ICU paragraph layout engine. |
<ICU>/source/io/ |
Contains the ICU I/O library. |
<ICU>/source/data/ |
This directory contains the source data in text format, which is
compiled into binary form during the ICU build process. It contains
several subdirectories, in which the data files are grouped by
function. Note that the build process must be run again after any
changes are made to this directory.
If some of the following directories are missing, it's probably
because you got an official download. If you need the data source files
for customization, then please download the complete ICU source code from the ICU repository.
- in/ A directory that contains a pre-built data library for
ICU. A standard source code package will contain this file without
several of the following directories. This is to simplify the build
process for the majority of users and to reduce platform porting
issues.
- brkitr/ Data files for character, word, sentence, title
casing and line boundary analysis.
- coll/ Data for collation tailorings.
- locales/ These .txt files contain ICU language and
culture-specific localization data. Two special bundles are
root, which is the fallback data and parent of other bundles,
and index, which contains a list of installed bundles.
Some of the locale data is split out into the type-specific
directories curr, lang, region, unit, and zone, described below.
- curr/ Locale data for currency symbols and names (including
plural forms).
- lang/ Locale data for names of languages, scripts, and locale
key names and values.
- region/ Locale data for names of regions.
- unit/ Locale data for measurement unit patterns and
names.
- zone/ Locale data for time zone names.
- mappings/ Here are the code page converter tables. These
.ucm files contain mappings to and from Unicode. These are compiled
into .cnv files. convrtrs.txt is the alias mapping table from
various converter name formats to ICU internal format and vice versa.
It produces cnvalias.icu. The makefiles ucmfiles.mk,
ucmcore.mk, and ucmebcdic.mk contain the list of
converters to be built.
- translit/ This directory contains transliterator rules as
resource bundles, and the special bundle translit_index which
lists the system transliterator aliases.
- unidata/ This directory contains the Unicode data files.
Please see http://www.unicode.org/ for more
information.
- misc/ The misc directory contains other data files which
did not fit into the above categories, including time zone
information, region-specific data, and other data derived from CLDR
supplemental data.
- out/ This directory contains the assembled memory mapped
files.
- out/build/ This directory contains intermediate (compiled)
files, such as .cnv, .res, etc.
If you are creating a special ICU build, you can set the ICU_DATA
environment variable to the out/ or the out/build/ directories, but
this is generally discouraged because most people set it incorrectly.
You can view the ICU Data
Management section of the ICU User's Guide for details.
|
<ICU>/source/test/intltest/ |
A test suite including all C++ APIs. For information about running
the test suite, see the build instructions specific to your platform
later in this document. |
<ICU>/source/test/cintltst/ |
A test suite written in C, including all C APIs. For information
about running the test suite, see the build instructions specific to your
platform later in this document. |
<ICU>/source/test/iotest/ |
A test suite written in C and C++ to test the icuio library. For
information about running the test suite, see the build instructions
specific to your platform later in this document. |
<ICU>/source/test/testdata/ |
Source text files for data, which are read by the tests. It contains
the subdirectories out/build/ which is used for intermediate
files, and out/ which contains testdata.dat. |
<ICU>/source/tools/ |
Tools for generating the data files. Data files are generated by
invoking <ICU>/source/data/build/makedata.bat on Win32 or
<ICU>/source/make on UNIX. |
<ICU>/source/samples/ |
Various sample programs that use ICU |
<ICU>/source/extra/ |
Non-supported API additions. Currently, it contains the 'uconv' tool
to perform codepage conversion on files. |
<ICU>/packaging/ |
This directory contain scripts and tools for packaging the final
ICU build for various release platforms. |
<ICU>/source/config/ |
Contains helper makefiles for platform specific build commands. Used
by 'configure'. |
<ICU>/source/allinone/ |
Contains top-level ICU workspace and project files, for instance to
build all of ICU under one MSVC project. |
<ICU>/include/ |
Contains the headers needed for developing software that uses ICU on
Windows. |
<ICU>/lib/ |
Contains the import libraries for linking ICU into your Windows
application. |
<ICU>/bin/ |
Contains the libraries and executables for using ICU on Windows. |
## How To Build And Install ICU
See the page on [building ICU4C](./build).
## How To Package ICU
See the page on [packaging ICU4C](./packaging).
## Important Notes About Using ICU
### Using ICU in a Multithreaded Environment
Some versions of ICU require calling the `u_init()` function from `uclean.h` to ensure that ICU is initialized properly. In those ICU versions, `u_init()` must be called before ICU is used from multiple threads. There is no harm in calling `u_init()` in a single-threaded application, on a single-CPU machine, or in other cases where `u_init()` is not required.
In addition to ensuring thread safety, `u_init()` also attempts to load at least one ICU data file. Assuming that all data files are packaged together (or are in the same folder in files mode), a failure code from `u_init()` usually means that the data cannot be found. In this case, the data may not be installed properly, or the application may have failed to call `udata_setCommonData()` or `u_setDataDirectory()` which specify to ICU where it can find its data.
Since `u_init()` will load only one or two data files, it cannot guarantee that all of the data that an application needs is available. It cannot check for all data files because the set of files is customizable, and some ICU services work without loading any data at all. An application should always check for error codes when opening ICU service objects (using `ucnv_open()`, `ucol_open()`, C++ constructors, etc.).
#### ICU 3.4 and later
ICU 3.4 self-initializes properly for multi-threaded use. It achieves this without performance penalty by hardcoding the core Unicode properties data, at the cost of some flexibility. (For details see Jitterbug 4497.)
`u_init()` can be used to check for data loading. It tries to load the converter alias table (`cnvalias.icu`).
#### ICU 2.6..3.2
These ICU versions require a call to `u_init()` before multi-threaded use. The services that are directly affected are those that don't have a service object and need to be fast: normalization and character properties.
`u_init()` loads and initializes the data files for normalization and character properties (`unorm.icu` and `uprops.icu`) and can therefore also be used to check for data loading.
#### ICU 2.4 and earlier
ICU 2.4 and earlier versions were not prepared for multithreaded use on multi-CPU platforms where the CPUs implement weak memory coherency. These CPUs include: Power4, Power5, Alpha, Itanium. `u_init()` was not defined yet.
#### Using ICU in a Multithreaded Environment on HP-UX
When ICU is built with aCC on HP-UX, the [`-AA`](http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=eb08b3f1eee02110b3f1eee02110275d6e10RCRD) compiler flag is used. It is required in order to use the latest `