Home | History | Annotate | only in /external/icu/icu4c
Up to higher level directory
NameDateSize
Android.mk21-Aug-2018672
APIChangeReport.html21-Aug-201880.3K
as_is/21-Aug-2018
icu4c.css21-Aug-20187.1K
LICENSE21-Aug-201819K
license.html21-Aug-2018622
packaging/21-Aug-2018
readme.html21-Aug-201880.5K
source/21-Aug-2018

readme.html

      1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      3 
      4 <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
      5   <head>
      6     <title>ReadMe for ICU 60.2</title>
      7     <meta name="COPYRIGHT" content=
      8     "Copyright (C) 2016 and later: Unicode, Inc. and others. License &amp; terms of use: http://www.unicode.org/copyright.html"/>
      9     <!-- meta name="COPYRIGHT" content=
     10     "Copyright (c) 1997-2016 IBM Corporation and others. All Rights Reserved." / -->
     11     <meta name="KEYWORDS" content=
     12     "ICU; International Components for Unicode; ICU4C; what's new; readme; read me; introduction; downloads; downloading; building; installation;" />
     13     <meta name="DESCRIPTION" content=
     14     "The introduction to the International Components for Unicode with instructions on building, installation, usage and other information about ICU." />
     15     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
     16 	<link type="text/css" href="./icu4c.css" rel="stylesheet"/>
     17   </head>
     18 
     19 <!--
     20     classes to use with the "body" -
     21         draft - if the release note is itself a draft (May be combined with the other two)
     22         rc  - if the release note is a release candidate
     23         milestone - if the release note is a milestone release
     24 -->
     25 
     26   <body>
     27   <!-- <body> -->
     28     <p class="only-draft"><b>Note:</b> This is a draft readme.</p>
     29 
     30     <h1>
     31       <span class="only-draft">DRAFT</span>
     32       International Components for Unicode<br/>
     33       <span class="only-rc">Release Candidate</span>
     34       <span class="only-milestone">(Milestone Release)</span>
     35       <abbr title="International Components for Unicode">ICU</abbr> 60.2 ReadMe
     36     </h1>
     37 
     38     <!-- Shouldn't need to comment/uncomment this paragraph, just change the body class -->
     39     <p class="note only-milestone">This is a development milestone release of ICU
     40       This milestone is intended for those wishing to get an early look at new features and API changes.
     41       It is not recommended for production use.</p>
     42 
     43     <!-- Shouldn't need to comment/uncomment this paragraph, just change the body class -->
     44     <p class="note only-rc">This is a release candidate version of ICU4C.
     45       It is not recommended for production use.</p>
     46 
     47     <p>Last updated: 2017-Dec-07<br/>
     48       Copyright &copy; 2016 and later: Unicode, Inc. and others. License &amp; terms of use:
     49       <a href="http://www.unicode.org/copyright.html">http://www.unicode.org/copyright.html</a><br/>
     50       Copyright &copy; 1997-2016 International Business Machines Corporation and others.
     51       All Rights Reserved.</p>
     52     <!-- Remember that there is a copyright at the end too -->
     53 
     54     <p class="note">This is a maintenance update of ICU 60,
     55       with a small number of bug fixes but no API changes.</p>
     56     <hr/>
     57 
     58     <h2 class="TOC">Table of Contents</h2>
     59 
     60     <ul class="TOC">
     61       <li><a href="#Introduction">Introduction</a></li>
     62 
     63       <li><a href="#GettingStarted">Getting Started</a></li>
     64 
     65       <li><a href="#News">What Is New In This Release?</a></li>
     66 
     67       <li><a href="#Download">How To Download the Source Code</a></li>
     68 
     69       <li><a href="#SourceCode">ICU Source Code Organization</a></li>
     70 
     71       <li>
     72         <a href="#HowToBuild">How To Build And Install ICU</a>
     73 
     74         <ul >
     75           <li><a href="#RecBuild">Recommended Build Options</a></li>
     76 
     77           <li><a href="#UserConfig">User-Configurable Settings</a></li>
     78 
     79           <li><a href="#HowToBuildWindows">Windows</a></li>
     80 
     81           <li><a href="#HowToBuildCygwin">Cygwin</a></li>
     82 
     83           <li><a href="#HowToBuildUNIX">UNIX</a></li>
     84 
     85           <li><a href="#HowToBuildZOS">z/OS (os/390)</a></li>
     86 
     87           <li><a href="#HowToBuildOS400">IBM i family (IBM i, i5/OS, OS/400)</a></li>
     88 
     89 		  <li><a href="#HowToCrossCompileICU">How to Cross Compile ICU</a></li>
     90         </ul>
     91       </li>
     92 
     93 
     94       <li><a href="#HowToPackage">How To Package ICU</a></li>
     95 
     96       <li>
     97         <a href="#ImportantNotes">Important Notes About Using ICU</a>
     98 
     99         <ul >
    100           <li><a href="#ImportantNotesMultithreaded">Using ICU in a Multithreaded
    101           Environment</a></li>
    102 
    103           <li><a href="#ImportantNotesWindows">Windows Platform</a></li>
    104 
    105           <li><a href="#ImportantNotesUNIX">UNIX Type Platforms</a></li>
    106         </ul>
    107       </li>
    108 
    109       <li>
    110         <a href="#PlatformDependencies">Platform Dependencies</a>
    111 
    112         <ul >
    113           <li><a href="#PlatformDependenciesNew">Porting To A New
    114           Platform</a></li>
    115 
    116           <li><a href="#PlatformDependenciesImpl">Platform Dependent
    117           Implementations</a></li>
    118         </ul>
    119       </li>
    120     </ul>
    121     <hr />
    122 
    123     <h2><a name="Introduction" href="#Introduction" id=
    124     "Introduction">Introduction</a></h2>
    125 
    126     <p>Today's software market is a global one in which it is desirable to
    127     develop and maintain one application (single source/single binary) that
    128     supports a wide variety of languages. The International Components for
    129     Unicode (ICU) libraries provide robust and full-featured Unicode services on
    130     a wide variety of platforms to help this design goal. The ICU libraries
    131     provide support for:</p>
    132 
    133     <ul>
    134       <li>The latest version of the Unicode standard</li>
    135 
    136       <li>Character set conversions with support for over 220 codepages</li>
    137 
    138       <li>Locale data for more than 300 locales</li>
    139 
    140       <li>Language sensitive text collation (sorting) and searching based on the
    141       Unicode Collation Algorithm (=ISO 14651)</li>
    142 
    143       <li>Regular expression matching and Unicode sets</li>
    144 
    145       <li>Transformations for normalization, upper/lowercase, script
    146       transliterations (50+ pairs)</li>
    147 
    148       <li>Resource bundles for storing and accessing localized information</li>
    149 
    150       <li>Date/Number/Message formatting and parsing of culture specific
    151       input/output formats</li>
    152 
    153       <li>Calendar specific date and time manipulation</li>
    154 
    155       <li>Text boundary analysis for finding characters, word and sentence
    156       boundaries</li>
    157     </ul>
    158 
    159     <p>ICU has a sister project ICU4J that extends the internationalization
    160     capabilities of Java to a level similar to ICU. The ICU C/C++ project is also
    161     called ICU4C when a distinction is necessary.</p>
    162 
    163     <h2><a name="GettingStarted" href="#GettingStarted" id=
    164     "GettingStarted">Getting started</a></h2>
    165 
    166     <p>This document describes how to build and install ICU on your machine. For
    167     other information about ICU please see the following table of links.<br />
    168      The ICU homepage also links to related information about writing
    169     internationalized software.</p>
    170 
    171     <table class="docTable" summary="These are some useful links regarding ICU and internationalization in general.">
    172       <caption>
    173         Here are some useful links regarding ICU and internationalization in
    174         general.
    175       </caption>
    176 
    177       <tr>
    178         <td>ICU, ICU4C &amp; ICU4J Homepage</td>
    179 
    180         <td><a href=
    181         "http://icu-project.org/">http://icu-project.org/</a></td>
    182       </tr>
    183 
    184       <tr>
    185         <td>FAQ - Frequently Asked Questions about ICU</td>
    186 
    187         <td><a href=
    188         "http://userguide.icu-project.org/icufaq">http://userguide.icu-project.org/icufaq</a></td>
    189       </tr>
    190 
    191       <tr>
    192         <td>ICU User's Guide</td>
    193 
    194         <td><a href=
    195         "http://userguide.icu-project.org/">http://userguide.icu-project.org/</a></td>
    196       </tr>
    197 
    198       <tr>
    199         <td>How To Use ICU</td>
    200 
    201         <td><a href="http://userguide.icu-project.org/howtouseicu">http://userguide.icu-project.org/howtouseicu</a></td>
    202       </tr>
    203 
    204       <tr>
    205         <td>Download ICU Releases</td>
    206 
    207         <td><a href=
    208         "http://site.icu-project.org/download">http://site.icu-project.org/download</a></td>
    209       </tr>
    210 
    211       <tr>
    212         <td>ICU4C API Documentation Online</td>
    213 
    214         <td><a href=
    215         "http://icu-project.org/apiref/icu4c/">http://icu-project.org/apiref/icu4c/</a></td>
    216       </tr>
    217 
    218       <tr>
    219         <td>Online ICU Demos</td>
    220 
    221         <td><a href=
    222         "http://demo.icu-project.org/icu-bin/icudemos">http://demo.icu-project.org/icu-bin/icudemos</a></td>
    223       </tr>
    224 
    225       <tr>
    226         <td>Contacts and Bug Reports/Feature Requests</td>
    227 
    228         <td><a href=
    229         "http://site.icu-project.org/contacts">http://site.icu-project.org/contacts</a></td>
    230       </tr>
    231     </table>
    232 
    233     <p><strong>Important:</strong> Please make sure you understand the <a href=
    234     "http://source.icu-project.org/repos/icu/trunk/icu4c/LICENSE">Copyright and License Information</a>.</p>
    235 
    236 
    237     <h2><a name="News" href="#News" id="News">What Is New In This Release?</a></h2>
    238 
    239     <p>See the <a href="http://site.icu-project.org/download/60">ICU 60 download page</a>
    240     for an overview of this release, important changes, new features, bug fixes, known issues,
    241     changes to supported platforms and build environments,
    242     and migration issues for existing applications migrating from previous ICU releases.</p>
    243 
    244     <p>See the <a href="APIChangeReport.html">API Change Report</a> for a complete list of
    245     APIs added, removed, or changed in this release.</p>
    246 
    247     <p><a name="RecentPreviousChanges" id="RecentPreviousChanges"></a>For
    248     changes in previous releases, see the
    249     main <a href="http://site.icu-project.org/download">ICU download page</a>
    250     with its version-specific subpages.</p>
    251 
    252 
    253     <h2><a name="Download" href="#Download" id="Download">How To Download the
    254     Source Code</a></h2>
    255 
    256     <p>There are two ways to download ICU releases:</p>
    257 
    258     <ul>
    259       <li><strong>Official Release Snapshot:</strong><br />
    260        If you want to use ICU (as opposed to developing it), you should download
    261       an official packaged version of the ICU source code. These versions are
    262       tested more thoroughly than day-to-day development builds of the system,
    263       and they are packaged in zip and tar files for convenient download. These
    264       packaged files can be found at <a href=
    265       "http://site.icu-project.org/download">http://site.icu-project.org/download</a>.<br />
    266        The packaged snapshots are named <strong>icu-nnnn.zip</strong> or
    267       <strong>icu-nnnn.tgz</strong>, where nnnn is the version number. The .zip
    268       file is used for Windows platforms, while the .tgz file is preferred on
    269       most other platforms.<br />
    270        Please unzip this file. </li>
    271 
    272       <li><strong>Subversion Source Repository:</strong><br />
    273        If you are interested in developing features, patches, or bug fixes for
    274       ICU, you should probably be working with the latest version of the ICU
    275       source code. You will need to check the code out of our Subversion repository to
    276       ensure that you have the most recent version of all of the files. See our
    277       <a href="http://site.icu-project.org/repository">source
    278       repository</a> for details.</li>
    279     </ul>
    280 
    281     <h2><a name="SourceCode" href="#SourceCode" id="SourceCode">ICU Source Code
    282     Organization</a></h2>
    283 
    284     <p>In the descriptions below, <strong><i>&lt;ICU&gt;</i></strong> is the full
    285     path name of the ICU directory (the top level directory from the distribution
    286     archives) in your file system. You can also view the <a href=
    287     "http://userguide.icu-project.org/design">ICU Architectural
    288     Design</a> section of the User's Guide to see which libraries you need for
    289     your software product. You need at least the data (<code>[lib]icudt</code>)
    290     and the common (<code>[lib]icuuc</code>) libraries in order to use ICU.</p>
    291 
    292     <table class="docTable" summary="The following files describe the code drop.">
    293       <caption>
    294         The following files describe the code drop.
    295       </caption>
    296 
    297       <tr>
    298         <th scope="col">File</th>
    299 
    300         <th scope="col">Description</th>
    301       </tr>
    302 
    303       <tr>
    304         <td>readme.html</td>
    305 
    306         <td>Describes the International Components for Unicode (this file)</td>
    307       </tr>
    308 
    309       <tr>
    310         <td>LICENSE</td>
    311 
    312         <td>Contains the text of the ICU license</td>
    313       </tr>
    314     </table>
    315 
    316     <p><br />
    317     </p>
    318 
    319     <table class="docTable" summary=
    320     "The following directories contain source code and data files.">
    321       <caption>
    322         The following directories contain source code and data files.
    323       </caption>
    324 
    325       <tr>
    326         <th scope="col">Directory</th>
    327 
    328         <th scope="col">Description</th>
    329       </tr>
    330 
    331       <tr>
    332         <td><i>&lt;ICU&gt;</i>/source/<b>common</b>/</td>
    333 
    334         <td>The core Unicode and support functionality, such as resource bundles,
    335         character properties, locales, codepage conversion, normalization,
    336         Unicode properties, Locale, and UnicodeString.</td>
    337       </tr>
    338 
    339       <tr>
    340         <td><i>&lt;ICU&gt;</i>/source/<b>i18n</b>/</td>
    341 
    342         <td>Modules in i18n are generally the more data-driven, that is to say
    343         resource bundle driven, components. These deal with higher-level
    344         internationalization issues such as formatting, collation, text break
    345         analysis, and transliteration.</td>
    346       </tr>
    347 
    348       <tr>
    349         <td><i>&lt;ICU&gt;</i>/source/<b>layoutex</b>/</td>
    350 
    351         <td>Contains the ICU paragraph layout engine.</td>
    352       </tr>
    353 
    354       <tr>
    355         <td><i>&lt;ICU&gt;</i>/source/<b>io</b>/</td>
    356 
    357         <td>Contains the ICU I/O library.</td>
    358       </tr>
    359 
    360       <tr>
    361         <td><i>&lt;ICU&gt;</i>/source/<b>data</b>/</td>
    362 
    363         <td>
    364           <p>This directory contains the source data in text format, which is
    365           compiled into binary form during the ICU build process. It contains
    366           several subdirectories, in which the data files are grouped by
    367           function. Note that the build process must be run again after any
    368           changes are made to this directory.</p>
    369 
    370           <p>If some of the following directories are missing, it's probably
    371           because you got an official download. If you need the data source files
    372           for customization, then please download the ICU source code from <a
    373           href="http://site.icu-project.org/repository">subversion</a>.</p>
    374 
    375           <ul>
    376             <li><b>in/</b> A directory that contains a pre-built data library for
    377             ICU. A standard source code package will contain this file without
    378             several of the following directories. This is to simplify the build
    379             process for the majority of users and to reduce platform porting
    380             issues.</li>
    381 
    382             <li><b>brkitr/</b> Data files for character, word, sentence, title
    383             casing and line boundary analysis.</li>
    384 
    385             <li><b>coll/</b> Data for collation tailorings. The makefile
    386             <b>colfiles.mk</b> contains the list of resource bundle files.</li>
    387 
    388             <li><b>locales/</b> These .txt files contain ICU language and
    389             culture-specific localization data. Two special bundles are
    390             <b>root</b>, which is the fallback data and parent of other bundles,
    391             and <b>index</b>, which contains a list of installed bundles. The
    392             makefile <b>resfiles.mk</b> contains the list of resource bundle
    393             files. Some of the locale data is split out into the type-specific
    394             directories curr, lang, region, unit, and zone, described below.</li>
    395 
    396             <li><b>curr/</b> Locale data for currency symbols and names (including
    397             plural forms), with its own makefile <b>resfiles.mk</b>.</li>
    398 
    399             <li><b>lang/</b> Locale data for names of languages, scripts, and locale
    400             key names and values, with its own makefile <b>resfiles.mk</b>.</li>
    401 
    402             <li><b>region/</b> Locale data for names of regions, with its own
    403             makefile <b>resfiles.mk</b>.</li>
    404 
    405             <li><b>unit/</b> Locale data for measurement unit patterns and names, 
    406             with its own makefile <b>resfiles.mk</b>.</li>
    407 
    408             <li><b>zone/</b> Locale data for time zone names, with its own
    409             makefile <b>resfiles.mk</b>.</li>
    410 
    411             <li><b>mappings/</b> Here are the code page converter tables. These
    412             .ucm files contain mappings to and from Unicode. These are compiled
    413             into .cnv files. <b>convrtrs.txt</b> is the alias mapping table from
    414             various converter name formats to ICU internal format and vice versa.
    415             It produces cnvalias.icu. The makefiles <b>ucmfiles.mk,
    416             ucmcore.mk,</b> and <b>ucmebcdic.mk</b> contain the list of
    417             converters to be built.</li>
    418 
    419             <li><b>translit/</b> This directory contains transliterator rules as
    420             resource bundles, a makefile <b>trnsfiles.mk</b> containing the list
    421             of installed system translitaration files, and as well the special
    422             bundle <b>translit_index</b> which lists the system transliterator
    423             aliases.</li>
    424 
    425             <li><b>unidata/</b> This directory contains the Unicode data files.
    426             Please see <a href=
    427             "http://www.unicode.org/">http://www.unicode.org/</a> for more
    428             information.</li>
    429 
    430             <li><b>misc/</b> The misc directory contains other data files which
    431             did not fit into the above categories, including time zone
    432             information, region-specific data, and other data derived from CLDR
    433             supplemental data.</li>
    434 
    435             <li><b>out/</b> This directory contains the assembled memory mapped
    436             files.</li>
    437 
    438             <li><b>out/build/</b> This directory contains intermediate (compiled)
    439             files, such as .cnv, .res, etc.</li>
    440           </ul>
    441 
    442           <p>If you are creating a special ICU build, you can set the ICU_DATA
    443           environment variable to the out/ or the out/build/ directories, but
    444           this is generally discouraged because most people set it incorrectly.
    445           You can view the <a href=
    446           "http://userguide.icu-project.org/icudata">ICU Data
    447           Management</a> section of the ICU User's Guide for details.</p>
    448         </td>
    449       </tr>
    450 
    451       <tr>
    452         <td><i>&lt;ICU&gt;</i>/source/test/<b>intltest</b>/</td>
    453 
    454         <td>A test suite including all C++ APIs. For information about running
    455         the test suite, see the build instructions specific to your platform
    456         later in this document.</td>
    457       </tr>
    458 
    459       <tr>
    460         <td><i>&lt;ICU&gt;</i>/source/test/<b>cintltst</b>/</td>
    461 
    462         <td>A test suite written in C, including all C APIs. For information
    463         about running the test suite, see the build instructions specific to your
    464         platform later in this document.</td>
    465       </tr>
    466 
    467       <tr>
    468         <td><i>&lt;ICU&gt;</i>/source/test/<b>iotest</b>/</td>
    469 
    470         <td>A test suite written in C and C++ to test the icuio library. For
    471         information about running the test suite, see the build instructions
    472         specific to your platform later in this document.</td>
    473       </tr>
    474 
    475       <tr>
    476         <td><i>&lt;ICU&gt;</i>/source/test/<b>testdata</b>/</td>
    477 
    478         <td>Source text files for data, which are read by the tests. It contains
    479         the subdirectories <b>out/build/</b> which is used for intermediate
    480         files, and <b>out/</b> which contains <b>testdata.dat.</b></td>
    481       </tr>
    482 
    483       <tr>
    484         <td><i>&lt;ICU&gt;</i>/source/<b>tools</b>/</td>
    485 
    486         <td>Tools for generating the data files. Data files are generated by
    487         invoking <i>&lt;ICU&gt;</i>/source/data/build/makedata.bat on Win32 or
    488         <i>&lt;ICU&gt;</i>/source/make on UNIX.</td>
    489       </tr>
    490 
    491       <tr>
    492         <td><i>&lt;ICU&gt;</i>/source/<b>samples</b>/</td>
    493 
    494         <td>Various sample programs that use ICU</td>
    495       </tr>
    496 
    497       <tr>
    498         <td><i>&lt;ICU&gt;</i>/source/<b>extra</b>/</td>
    499 
    500         <td>Non-supported API additions. Currently, it contains the 'uconv' tool
    501         to perform codepage conversion on files.</td>
    502       </tr>
    503 
    504       <tr>
    505         <td><i>&lt;ICU&gt;</i>/<b>packaging</b>/</td>
    506 
    507         <td>This directory contain scripts and tools for packaging the final
    508         ICU build for various release platforms.</td>
    509       </tr>
    510 
    511       <tr>
    512         <td><i>&lt;ICU&gt;</i>/source/<b>config</b>/</td>
    513 
    514         <td>Contains helper makefiles for platform specific build commands. Used
    515         by 'configure'.</td>
    516       </tr>
    517 
    518       <tr>
    519         <td><i>&lt;ICU&gt;</i>/source/<b>allinone</b>/</td>
    520 
    521         <td>Contains top-level ICU workspace and project files, for instance to
    522         build all of ICU under one MSVC project.</td>
    523       </tr>
    524 
    525       <tr>
    526         <td><i>&lt;ICU&gt;</i>/<b>include</b>/</td>
    527 
    528         <td>Contains the headers needed for developing software that uses ICU on
    529         Windows.</td>
    530       </tr>
    531 
    532       <tr>
    533         <td><i>&lt;ICU&gt;</i>/<b>lib</b>/</td>
    534 
    535         <td>Contains the import libraries for linking ICU into your Windows
    536         application.</td>
    537       </tr>
    538 
    539       <tr>
    540         <td><i>&lt;ICU&gt;</i>/<b>bin</b>/</td>
    541 
    542         <td>Contains the libraries and executables for using ICU on Windows.</td>
    543       </tr>
    544     </table>
    545     <!-- end of ICU structure ==================================== -->
    546 
    547     <h2><a name="HowToBuild" href="#HowToBuild" id="HowToBuild">How To Build And
    548     Install ICU</a></h2>
    549 
    550     <h3><a name="RecBuild" href="#RecBuild" id=
    551     "RecBuild">Recommended Build Options</a></h3>
    552 
    553     <p>Depending on the platform and the type of installation,
    554     we recommend a small number of modifications and build options.
    555     Note that C99 compatibility is now required.</p>
    556     <ul>
    557       <li><b>Namespace:</b> By default, unicode/uversion.h has
    558         "using namespace icu;" which defeats much of the purpose of the namespace.
    559         (This is for historical reasons: Originally, ICU4C did not use namespaces,
    560         and some compilers did not support them. The default "using" statement
    561         preserves source code compatibility.)<br />
    562         If this compatibility is not an issue, we recommend you turn this off
    563          via <code>-DU_USING_ICU_NAMESPACE=0</code>
    564         or by modifying unicode/uversion.h:
    565 <pre>Index: source/common/unicode/uversion.h
    566 ===================================================================
    567 --- source/common/unicode/uversion.h    (revision 26606)
    568 +++ source/common/unicode/uversion.h    (working copy)
    569 @@ -180,7 +180,8 @@
    570  #   define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
    571 
    572  #   ifndef U_USING_ICU_NAMESPACE
    573 -#       define U_USING_ICU_NAMESPACE 1
    574 +        // Set to 0 to force namespace declarations in ICU usage.
    575 +#       define U_USING_ICU_NAMESPACE 0
    576  #   endif
    577  #   if U_USING_ICU_NAMESPACE
    578          U_NAMESPACE_USE
    579 </pre>
    580         ICU call sites then either qualify ICU types explicitly,
    581         for example <code>icu::UnicodeString</code>,
    582         or do <code>using icu::UnicodeString;</code> where appropriate.</li>
    583       <li><b>Hardcode the default charset to UTF-8:</b> On platforms where
    584         the default charset is always UTF-8,
    585         like MacOS X and some Linux distributions,
    586         we recommend hardcoding ICU's default charset to UTF-8.
    587         This means that some implementation code becomes simpler and faster,
    588         and statically linked ICU libraries become smaller.
    589         (See the <a href="http://icu-project.org/apiref/icu4c/platform_8h.html#a0a33e1edf3cd23d9e9c972b63c9f7943">U_CHARSET_IS_UTF8</a>
    590         API documentation for more details.)<br />
    591         You can <code>-DU_CHARSET_IS_UTF8=1</code> or
    592         modify unicode/utypes.h (in ICU 4.8 and below)
    593         or modify unicode/platform.h (in ICU 49 and higher):
    594 <pre>Index: source/common/unicode/utypes.h
    595 ===================================================================
    596 --- source/common/unicode/utypes.h      (revision 26606)
    597 +++ source/common/unicode/utypes.h      (working copy)
    598 @@ -160,7 +160,7 @@
    599   * @see UCONFIG_NO_CONVERSION
    600   */
    601  #ifndef U_CHARSET_IS_UTF8
    602 -#   define U_CHARSET_IS_UTF8 0
    603 +#   define U_CHARSET_IS_UTF8 1
    604  #endif
    605 
    606  /*===========================================================================*/
    607 </pre></li>
    608       <li><b>UnicodeString constructors:</b> The UnicodeString class has
    609         several single-argument constructors that are not marked "explicit"
    610         for historical reasons.
    611         This can lead to inadvertent construction of a <code>UnicodeString</code>
    612         with a single character by using an integer,
    613         and it can lead to inadvertent dependency on the conversion framework
    614         by using a C string literal.<br />
    615         Beginning with ICU 49, you should do the following:
    616         <ul>
    617           <li>Consider marking the from-<code>UChar</code>
    618             and from-<code>UChar32</code> constructors explicit via
    619             <code>-DUNISTR_FROM_CHAR_EXPLICIT=explicit</code> or similar.</li>
    620           <li>Consider marking the from-<code>const char*</code> and
    621             from-<code>const UChar*</code> constructors explicit via
    622             <code>-DUNISTR_FROM_STRING_EXPLICIT=explicit</code> or similar.</li>
    623         </ul>
    624         Note: The ICU test suites cannot be compiled with these settings.
    625       </li>
    626       <li><b>utf.h, utf8.h, utf16.h, utf_old.h:</b>
    627         By default, utypes.h (and thus almost every public ICU header)
    628         includes all of these header files.
    629         Often, none of them are needed, or only one or two of them.
    630         All of utf_old.h is deprecated or obsolete.<br />
    631         Beginning with ICU 49,
    632         you should define <code>U_NO_DEFAULT_INCLUDE_UTF_HEADERS</code> to 1
    633         (via -D or uconfig.h, as above)
    634         and include those header files explicitly that you actually need.<br />
    635         Note: The ICU test suites cannot be compiled with this setting.</li>
    636       <li><b>utf_old.h:</b>
    637         All of utf_old.h is deprecated or obsolete.<br />
    638         Beginning with ICU 60,
    639         you should define <code>U_HIDE_OBSOLETE_UTF_OLD_H</code> to 1
    640         (via -D or uconfig.h, as above).
    641         Use of any of these macros should be replaced as noted
    642         in the comments for the obsolete macro.<br />
    643         Note: The ICU test suites <i>can</i> be compiled with this setting.</li>
    644       <li><b>.dat file:</b> By default, the ICU data is built into
    645         a shared library (DLL). This is convenient because it requires no
    646         install-time or runtime configuration,
    647         but the library is platform-specific and cannot be modified.
    648         A .dat package file makes the opposite trade-off:
    649         Platform-portable (except for endianness and charset family, which
    650         can be changed with the icupkg tool)
    651         and modifiable (also with the icupkg tool).
    652         If a path is set, then single data files (e.g., .res files)
    653         can be copied to that location to provide new locale data
    654         or conversion tables etc.<br />
    655         The only drawback with a .dat package file is that the application
    656         needs to provide ICU with the file system path to the package file
    657         (e.g., by calling <code>u_setDataDirectory()</code>)
    658         or with a pointer to the data (<code>udata_setCommonData()</code>)
    659         before other ICU API calls.
    660         This is usually easy if ICU is used from an application where
    661         <code>main()</code> takes care of such initialization.
    662         It may be hard if ICU is shipped with
    663         another shared library (such as the Xerces-C++ XML parser)
    664         which does not control <code>main()</code>.<br />
    665         See the <a href="http://userguide.icu-project.org/icudata">User Guide ICU Data</a>
    666         chapter for more details.<br />
    667         If possible, we recommend building the .dat package.
    668         Specify <code>--with-data-packaging=archive</code>
    669         on the configure command line, as in<br />
    670         <code>runConfigureICU Linux --with-data-packaging=archive</code><br />
    671         (Read the configure script's output for further instructions.
    672         On Windows, the Visual Studio build generates both the .dat package
    673         and the data DLL.)<br />
    674         Be sure to install and use the tiny stubdata library
    675         rather than the large data DLL.</li>
    676       <li><b>Static libraries:</b> It may make sense to build the ICU code
    677         into static libraries (.a) rather than shared libraries (.so/.dll).
    678         Static linking reduces the overall size of the binary by removing
    679         code that is never called.<br />
    680         Example configure command line:<br />
    681         <code>runConfigureICU Linux --enable-static --disable-shared</code></li>
    682       <li><b>Out-of-source build:</b> It is usually desirable to keep the ICU
    683         source file tree clean and have build output files written to
    684         a different location. This is called an "out-of-source build".
    685         Simply invoke the configure script from the target location:
    686 <pre>~/icu$ svn export http://source.icu-project.org/repos/icu/trunk/icu4c
    687 ~/icu$ mkdir trunk-dev
    688 ~/icu$ cd trunk-dev
    689 ~/icu/trunk-dev$ ../trunk/source/runConfigureICU Linux
    690 ~/icu/trunk-dev$ make check</pre><br/>
    691         (Note: this example shows a relative path to
    692          <code>runConfigureICU</code>. If you experience difficulty,
    693          try using an absolute path to <code>runConfigureICU</code>
    694          instead.)
    695       </li>
    696     </ul>
    697     <h4>ICU as a System-Level Library</h4>
    698     <p>If ICU is installed as a system-level library, there are further
    699       opportunities and restrictions to consider.
    700       For details, see the <em>Using ICU as an Operating System Level Library</em>
    701       section of the <a href="http://userguide.icu-project.org/design">User Guide ICU Architectural Design</a> chapter.</p>
    702     <ul>
    703       <li><b>Data path:</b> For a system-level library, it is best to load
    704         ICU data from the .dat package file because the file system path
    705         to the .dat package file can be hardcoded. ICU will automatically set
    706         the path to the final install location using U_ICU_DATA_DEFAULT_DIR.
    707         Alternatively, you can set <code>-DICU_DATA_DIR=/path/to/icu/data</code>
    708         when building the ICU code. (Used by source/common/putil.c.)<br/>
    709         Consider also setting <code>-DICU_NO_USER_DATA_OVERRIDE</code>
    710         if you do not want the "ICU_DATA" environment variable to be used.
    711         (An application can still override the data path via
    712         <code>u_setDataDirectory()</code> or
    713         <code>udata_setCommonData()</code>.</li>
    714       <li><b>Hide draft API:</b> API marked with <code>@draft</code>
    715         is new and not yet stable. Applications must not rely on unstable
    716         APIs from a system-level library.
    717         Define <code>U_HIDE_DRAFT_API</code>, <code>U_HIDE_INTERNAL_API</code>
    718         and <code>U_HIDE_SYSTEM_API</code>
    719         by modifying unicode/utypes.h before installing it.</li>
    720       <li><b>Only C APIs:</b> Applications must not rely on C++ APIs from a
    721         system-level library because binary C++ compatibility
    722         across library and compiler versions is very hard to achieve.
    723         Most ICU C++ APIs are in header files that contain a comment with
    724         <code>\brief C++ API</code>.
    725         Consider not installing these header files.</li>
    726       <li><b>Disable renaming:</b> By default, ICU library entry point names
    727         have an ICU version suffix. Turn this off for a system-level installation,
    728         to enable upgrading ICU without breaking applications. For example:<br />
    729         <code>runConfigureICU Linux --disable-renaming</code><br />
    730         The public header files from this configuration must be installed
    731         for applications to include and get the correct entry point names.</li>
    732     </ul>
    733 
    734     <h3><a name="UserConfig" href="#UserConfig" id="UserConfig">User-Configurable Settings</a></h3>
    735     <p>ICU4C can be customized via a number of user-configurable settings.
    736     Many of them are controlled by preprocessor macros which are
    737     defined in the <code>source/common/unicode/uconfig.h</code> header file.
    738     Some turn off parts of ICU, for example conversion or collation,
    739     trading off a smaller library for reduced functionality.
    740     Other settings are recommended (see previous section)
    741     but their default values are set for better source code compatibility.</p>
    742 
    743     <p>In order to change such user-configurable settings, you can
    744     either modify the <code>uconfig.h</code> header file by adding
    745     a specific <code>#define ...</code> for one or more of the macros
    746     before they are first tested,
    747     or set the compiler's preprocessor flags (<code>CPPFLAGS</code>) to include
    748     an equivalent <code>-D</code> macro definition.</p>
    749 
    750     <h3><a name="HowToBuildWindows" href="#HowToBuildWindows" id=
    751     "HowToBuildWindows">How To Build And Install On Windows</a></h3>
    752 
    753     <p>Building International Components for Unicode requires:</p>
    754 
    755     <ul>
    756       <li>Microsoft Windows</li>
    757 
    758       <li>Microsoft Visual C++ (part of <a href="https://www.visualstudio.com/">Visual Studio</a>) (see the ICU download page for the currently compatible version)</li>
    759       
    760       <li><i><b>Optional:</b></i> A version of the <a href="https://developer.microsoft.com/windows/downloads">Windows 10 SDK</a> (if you want to build the UWP projects)</li>
    761     </ul>
    762         <p class="note"><a href="#HowToBuildCygwin">Cygwin</a> is required if using a version of MSVC other than the one
    763         compatible with the supplied project files or if other compilers are used to build ICU. (e.g. GCC)</p>
    764 
    765     <p>The steps are:</p>
    766 
    767     <ol>
    768       <li>Unzip the icu-XXXX.zip file into any convenient location. Using command
    769       line zip, type "unzip -a icu-XXXX.zip -d drive:\directory", or just use
    770       WinZip.</li>
    771 
    772       <li>Be sure that the ICU binary directory, <i>&lt;ICU&gt;</i>\bin\, is
    773       included in the <strong>PATH</strong> environment variable. The tests will
    774       not work without the location of the ICU DLL files in the path.</li>
    775 
    776       <li>Open the "<i>&lt;ICU&gt;</i>\source\allinone\allinone.sln" workspace
    777       file in Microsoft Visual Studio. (This solution includes all the
    778       International Components for Unicode libraries, necessary ICU building
    779       tools, and the test suite projects). Please see the <a href=
    780       "#HowToBuildWindowsCommandLine">command line note below</a> if you want to
    781       build from the command line instead.</li>
    782 
    783       <li>You may need to re-target the UWP projects to the version of the SDK that you have installed. In Visual Studio you can
    784       right-click on the UWP projects and select the option 'Retarget SDK Version'. Note: You do not need to have a copy of 
    785       the Windows 10 SDK installed in order to build the non-UWP projects in Visual Studio. If the SDK is not installed then the
    786       UWP projects will simply not be loaded.</li>
    787 
    788       <li>Set the active platform to "Win32" or "x64" (See <a href="#HowToBuildWindowsPlatform">Windows platform note</a> below)
    789       and configuration to "Debug" or "Release" (See <a href="#HowToBuildWindowsConfig">Windows configuration note</a> below).</li>
    790 
    791       <li>Choose the "Build" menu and select "Rebuild Solution". If you want to
    792       build the Debug and Release at the same time, see the <a href=
    793       "#HowToBuildWindowsBatch">batch configuration note</a> below.</li>
    794 
    795 
    796       <li>Run the tests. They can be run from the command line or from within Visual Studio.
    797 
    798 	 <h4>Running the Tests from the Windows Command Line (cmd)</h4>
    799 	<ul>
    800 	   <li>For x86 (32 bit) and Debug, use: <br />
    801 
    802 	<tt><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat  <i>Platform</i> <i>Configuration</i>
    803 		</tt> <br />
    804        </li>
    805 	<li>So, for example:
    806 				 <br />
    807 		<samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat  <b>x86</b> <b>Debug</b></samp>
    808 				or
    809 		<samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat  <b>x86</b> <b>Release</b></samp>
    810 				or
    811 		<samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat  <b>x64</b> <b>Release</b></samp></li>
    812 	</ul>
    813 
    814          <h4>Running the Tests from within Visual Studio</h4>
    815 
    816 	<ol>
    817       <li>Run the C++ test suite, "intltest". To do this: set the active startup
    818       project to "intltest", and press Ctrl+F5 to run it. Make sure that it
    819       passes without any errors.</li>
    820 
    821       <li>Run the C test suite, "cintltst". To do this: set the active startup
    822       project to "cintltst", and press Ctrl+F5 to run it. Make sure that it
    823       passes without any errors.</li>
    824 
    825       <li>Run the I/O test suite, "iotest". To do this: set the active startup
    826       project to "iotest", and press Ctrl+F5 to run it. Make sure that it passes
    827       without any errors.</li>
    828 
    829 	</ol>
    830 
    831 	</li>
    832 
    833       <li>You are now able to develop applications with ICU by using the
    834       libraries and tools in <i>&lt;ICU&gt;</i>\bin\. The headers are in
    835       <i>&lt;ICU&gt;</i>\include\ and the link libraries are in
    836       <i>&lt;ICU&gt;</i>\lib\. To install the ICU runtime on a machine, or ship
    837       it with your application, copy the needed components from
    838       <i>&lt;ICU&gt;</i>\bin\ to a location on the system PATH or to your
    839       application directory.</li>
    840     </ol>
    841 
    842     <p><a name="HowToBuildWindowsCommandLine" id=
    843     "HowToBuildWindowsCommandLine"><strong>Using MSDEV At The Command Line
    844     Note:</strong></a> You can build ICU from the command line. Assuming that you
    845     have properly installed Microsoft Visual C++ to support command line
    846     execution, you can run the following command to build the 32-bit Release version:
    847     <code>'devenv.com <i>&lt;ICU&gt;</i>\source\allinone\allinone.sln /build "Release|Win32"'</code>.
    848     Or to build the 64-bit Release version from the command line: 
    849     <code>'devenv.com <i>&lt;ICU&gt;</i>\source\allinone\allinone.sln /build "Release|x64"'</code>.
    850     <br />You can also use Cygwin with this compiler to build ICU, and you can refer to the <a href=
    851     "#HowToBuildCygwin">How To Build And Install On Windows with Cygwin</a>
    852     section for more details.</p>
    853 
    854     <p><a name="HowToBuildWindowsPlatform" id=
    855     "HowToBuildWindowsPlatform"><strong>Setting Active Platform
    856     Note:</strong></a> Even though you are able to select "x64" as the active platform, if your operating system is
    857     not a 64 bit version of Windows, the build will fail. To set the active platform, two different possibilities are:</p>
    858 
    859     <ul>
    860       <li>Choose "Build" menu, select "Configuration Manager...", and select
    861       "Win32" or "x64" for the Active Platform Solution.</li>
    862 
    863       <li>Another way is to select the desired build configuration from "Solution
    864       Platforms" dropdown menu from the standard toolbar. It will say
    865       "Win32" or "x64" in the dropdown list.</li>
    866     </ul>
    867 
    868     <p><a name="HowToBuildWindowsConfig" id=
    869     "HowToBuildWindowsConfig"><strong>Setting Active Configuration
    870     Note:</strong></a> To set the active configuration, two different
    871     possibilities are:</p>
    872 
    873     <ul>
    874       <li>Choose "Build" menu, select "Configuration Manager...", and select
    875       "Release" or "Debug" for the Active Configuration Solution.</li>
    876 
    877       <li>Another way is to select the desired build configuration from "Solution
    878       Configurations" dropdown menu from the standard toolbar. It will say
    879       "Release" or "Debug" in the dropdown list.</li>
    880     </ul>
    881 
    882     <p><a name="HowToBuildWindowsBatch" id="HowToBuildWindowsBatch"><strong>Batch
    883     Configuration Note:</strong></a> If you want to build the Win32 and x64 platforms and
    884     Debug and Release configurations at the same time, choose "Build" menu, and select "Batch
    885     Build...". Click the "Select All" button, and then click the "Rebuild"
    886     button.</p>
    887 
    888     <h3><a name="HowToBuildCygwin" href="#HowToBuildCygwin" id=
    889     "HowToBuildCygwin">How To Build And Install On Windows with Cygwin</a></h3>
    890 
    891     <p>Building International Components for Unicode with this configuration
    892     requires:</p>
    893 
    894     <ul>
    895       <li>Microsoft Windows</li>
    896 
    897       <li>Microsoft Visual C++ (from Visual Studio 2015 or newer, when gcc isn't used).</li>
    898 
    899       <li>
    900         Cygwin with the following installed:
    901 
    902         <ul>
    903           <li>bash</li>
    904 
    905           <li>GNU make</li>
    906 
    907           <li>ar</li>
    908 
    909           <li>ranlib</li>
    910 
    911           <li>man (if you plan to look at the man pages)</li>
    912         </ul>
    913       </li>
    914     </ul>
    915 
    916     <p>There are two ways you can build ICU with Cygwin. You can build with gcc
    917     or Microsoft Visual C++. If you use gcc, the resulting libraries and tools
    918     will depend on the Cygwin environment. If you use Microsoft Visual C++, the
    919     resulting libraries and tools do not depend on Cygwin and can be more easily
    920     distributed to other Windows computers (the generated man pages and shell
    921     scripts still need Cygwin). To build with gcc, please follow the "<a href=
    922     "#HowToBuildUNIX">How To Build And Install On UNIX</a>" instructions, while
    923     you are inside a Cygwin bash shell. To build with Microsoft Visual C++,
    924     please use the following instructions:</p>
    925 
    926     <ol>
    927       <li>Start the Windows "Command Prompt" window. This is different from the
    928       gcc build, which requires the Cygwin Bash command prompt. The Microsoft
    929       Visual C++ compiler will not work with a bash command prompt.</li>
    930 
    931       <li>If the computer isn't set up to use Visual C++ from the command line,
    932       you need to run vcvars32.bat.<br />For example:<br />
    933       "<tt>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat</tt>"
    934       can be used for 32-bit builds <strong>or</strong> <br />
    935       "<tt>C:\Program Files (x86)\Microsoft Visual Studio 14\VC\bin\x86_amd64\vcvarsx86_amd64.bat</tt>"
    936       can be used for 64-bit builds on Windows x64.</li>
    937 
    938       <li>Unzip the icu-XXXX.zip file into any convenient location. Using command
    939       line zip, type "unzip -a icu-XXXX.zip -d drive:\directory", or just use
    940       WinZip.</li>
    941 
    942       <li>Change directory to "icu/source", which is where you unzipped ICU.</li>
    943 
    944       <li>Run "<tt>bash <a href="source/runConfigureICU">./runConfigureICU</a>
    945       Cygwin/MSVC</tt>" (See <a href="#HowToWindowsConfigureICU">Windows
    946       configuration note</a> and non-functional configure options below).</li>
    947 
    948       <li>Type <tt>"make"</tt> to compile the libraries and all the data files.
    949       This make command should be GNU make.</li>
    950 
    951       <li>Optionally, type <tt>"make check"</tt> to run the test suite, which
    952       checks for ICU's functionality integrity (See <a href=
    953       "#HowToTestWithoutGmake">testing note</a> below).</li>
    954 
    955       <li>Type <tt>"make install"</tt> to install ICU. If you used the --prefix=
    956       option on configure or runConfigureICU, ICU will be installed to the
    957       directory you specified. (See <a href="#HowToInstallICU">installation
    958       note</a> below).</li>
    959     </ol>
    960 
    961     <p><a name="HowToWindowsConfigureICU" id=
    962     "HowToWindowsConfigureICU"><strong>Configuring ICU on Windows
    963     NOTE:</strong></a> </p>
    964     <p>
    965     Ensure that the order of the PATH is MSVC, Cygwin, and then other PATHs. The configure
    966     script needs certain tools in Cygwin (e.g. grep).
    967     </p>
    968     <p>
    969     Also, you may need to run <tt>"dos2unix.exe"</tt> on all of the scripts (e.g. configure)
    970     in the top source directory of ICU. To avoid this issue, you can download
    971     the ICU source for Unix platforms (icu-xxx.tgz).
    972     </p>
    973     <p>In addition to the Unix <a href=
    974     "#HowToConfigureICU">configuration note</a> the following configure options
    975     currently do not work on Windows with Microsoft's compiler. Some options can
    976     work by manually editing <tt>icu/source/common/unicode/pwin32.h</tt>, but
    977     manually editing the files is not recommended.</p>
    978 
    979     <ul>
    980       <li><tt>--disable-renaming</tt></li>
    981 
    982       <li><tt>--enable-tracing</tt></li>
    983 
    984       <li><tt>--enable-rpath</tt></li>
    985 
    986       <li><tt>--enable-static</tt> (Requires that U_STATIC_IMPLEMENTATION be
    987       defined in user code that links against ICU's static libraries.)</li>
    988 
    989       <li><tt>--with-data-packaging=files</tt> (The pkgdata tool currently does
    990       not work in this mode. Manual packaging is required to use this mode.)</li>
    991     </ul>
    992 
    993     <h3><a name="HowToBuildUNIX" href="#HowToBuildUNIX" id="HowToBuildUNIX">How
    994     To Build And Install On UNIX</a></h3>
    995 
    996     <p>Building International Components for Unicode on UNIX requires:</p>
    997 
    998     <ul>
    999       <li>A C++ compiler installed on the target machine (for example: gcc, CC,
   1000       xlC_r, aCC, cxx, etc...).</li>
   1001 
   1002       <li>An ANSI C compiler installed on the target machine (for example:
   1003       cc).</li>
   1004 
   1005       <li>A recent version of GNU make (3.80+).</li>
   1006 
   1007       <li>For a list of z/OS tools please view the <a href="#HowToBuildZOS">z/OS
   1008       build section</a> of this document for further details.</li>
   1009     </ul>
   1010 
   1011     <p>Here are the steps to build ICU:</p>
   1012 
   1013     <ol>
   1014       <li>Decompress the icu-<i>X</i>.<i>Y</i>.tgz (or
   1015       icu-<i>X</i>.<i>Y</i>.tar.gz) file. For example, <samp>gunzip -d &lt; icu-<i>X</i>.<i>Y</i>.tgz | tar xvf -</samp></li>
   1016 
   1017       <li>Change directory to <code>icu/source</code>.
   1018           <samp>cd icu/source</samp>
   1019           </li>
   1020 
   1021       <li>Some files may have the wrong permissions.<samp>chmod +x runConfigureICU configure install-sh</samp></li>
   1022 
   1023       <li>Run the <span style='font-family: monospace;'><a href="source/runConfigureICU">runConfigureICU</a></span>
   1024       script for your platform. (See <a href="#HowToConfigureICU">configuration
   1025       note</a> below).</li>
   1026 
   1027       <li>Now build: <samp>gmake</samp> (or just <code>make</code> if GNU make is the default make on
   1028       your platform) to compile the libraries and all the data files. The proper
   1029       name of the GNU make command is printed at the end of the configuration
   1030       run, as in <tt>"You must use gmake to compile ICU"</tt>.
   1031       <br/>
   1032       Note that the compilation command output may be simplified on your platform.  If this is the case, you will see just:
   1033       <tt>gcc ... stubdata.c</tt>
   1034       rather than
   1035       <tt>gcc  -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1 -D_REENTRANT -I../common -DU_ATTRIBUTE_DEPRECATED= -O2 -Wall -std=c99 -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -c -DPIC -fPIC -o stubdata.o stubdata.c</tt>
   1036       <br/>
   1037       If you need to see the whole compilation line,  use <span style='font-family: monospace;'>"gmake VERBOSE=1"</span>. The full compilation line will print if an error occurs.
   1038       </li>
   1039 
   1040       <li>Optionally,<samp>gmake check</samp> will run the test suite, which
   1041       checks for ICU's functionality integrity (See <a href=
   1042       "#HowToTestWithoutGmake">testing note</a> below).</li>
   1043 
   1044       <li>To install, <samp>gmake install</samp> to install ICU. If you used the --prefix=
   1045       option on configure or runConfigureICU, ICU will be installed to the
   1046       directory you specified. (See <a href="#HowToInstallICU">installation
   1047       note</a> below).</li>
   1048     </ol>
   1049 
   1050     <p><a name="HowToConfigureICU" id="HowToConfigureICU"><strong>Configuring ICU
   1051     NOTE:</strong></a> Type <tt>"./runConfigureICU --help"</tt> for help on how
   1052     to run it and a list of supported platforms. You may also want to type
   1053     <tt>"./configure --help"</tt> to print the available configure options that
   1054     you may want to give runConfigureICU. If you are not using the
   1055     runConfigureICU script, or your platform is not supported by the script, you
   1056     may need to set your CC, CXX, CFLAGS and CXXFLAGS environment variables, and
   1057     type <tt>"./configure"</tt>.
   1058     HP-UX users, please see this <a href="#ImportantNotesHPUX">note regarding
   1059     HP-UX multithreaded build issues</a> with newer compilers. Solaris users,
   1060     please see this <a href="#ImportantNotesSolaris">note regarding Solaris
   1061     multithreaded build issues</a>.</p>
   1062 
   1063     <p>ICU is built with strict compiler warnings enabled by default.  If this
   1064     causes excessive numbers of warnings on your platform, use the --disable-strict
   1065     option to configure to reduce the warning level.</p>
   1066 
   1067     <p><a name="HowToTestWithoutGmake" id="HowToTestWithoutGmake"><strong>Running
   1068     The Tests From The Command Line NOTE:</strong></a> You may have to set
   1069     certain variables if you with to run test programs individually, that is
   1070     apart from "gmake check". The environment variable <strong>ICU_DATA</strong>
   1071     can be set to the full pathname of the data directory to indicate where the
   1072     locale data files and conversion mapping tables are when you are not using
   1073     the shared library (e.g. by using the .dat archive or the individual data
   1074     files). The trailing "/" is required after the directory name (e.g.
   1075     "$Root/source/data/out/" will work, but the value "$Root/source/data/out" is
   1076     not acceptable). You do not need to set <strong>ICU_DATA</strong> if the
   1077     complete shared data library is in your library path.</p>
   1078 
   1079     <p><a name="HowToInstallICU" id="HowToInstallICU"><strong>Installing ICU
   1080     NOTE:</strong></a> Some platforms use package management tools to control the
   1081     installation and uninstallation of files on the system, as well as the
   1082     integrity of the system configuration. You may want to check if ICU can be
   1083     packaged for your package management tools by looking into the "packaging"
   1084     directory. (Please note that if you are using a snapshot of ICU from Subversion, it
   1085     is probable that the packaging scripts or related files are not up to date
   1086     with the contents of ICU at this time, so use them with caution).</p>
   1087 
   1088     <h3><a name="HowToBuildZOS" href="#HowToBuildZOS" id="HowToBuildZOS">How To
   1089     Build And Install On z/OS (OS/390)</a></h3>
   1090 
   1091     <p>You can install ICU on z/OS or OS/390 (the previous name of z/OS), but IBM
   1092     tests only the z/OS installation. You install ICU in a z/OS UNIX system
   1093     services file system such as HFS or zFS. On this platform, it is important
   1094     that you understand a few details:</p>
   1095 
   1096     <ul>
   1097       <li>The makedep and GNU make tools are required for building ICU. If it
   1098       is not already installed on your system, it is available at the <a href=
   1099       "http://www-03.ibm.com/servers/eserver/zseries/zos/unix/bpxa1toy.html">z/OS UNIX -
   1100       Tools and Toys</a> site. The PATH environment variable should be updated to
   1101       contain the location of this executable prior to build. Failure to add these
   1102       tools to your PATH will cause ICU build failures or cause pkgdata to fail
   1103       to run.</li>
   1104 
   1105       <li>Since USS does not support using the mmap() function over NFS, it is
   1106       recommended that you build ICU on a local filesystem. Once ICU has been
   1107       built, you should not have this problem while using ICU when the data
   1108       library has been built as a shared library, which is this is the default
   1109       setting.</li>
   1110 
   1111       <li>Encoding considerations: The source code assumes that it is compiled
   1112       with codepage ibm-1047 (to be exact, the UNIX System Services variant of
   1113       it). The pax command converts all of the source code files from ASCII to
   1114       codepage ibm-1047 (USS) EBCDIC. However, some files are binary files and
   1115       must not be converted, or must be converted back to their original state.
   1116       You can use the <a href="as_is/os390/unpax-icu.sh">unpax-icu.sh</a> script
   1117       to do this for you automatically. It will unpackage the tar file and
   1118       convert all the necessary files for you automatically.</li>
   1119 
   1120       <li>z/OS supports both native S/390 hexadecimal floating point and (with
   1121       OS/390 2.6 and later) IEEE 754 binary floating point. This is a compile
   1122       time option. Applications built with IEEE should use ICU DLLs that are
   1123       built with IEEE (and vice versa). The environment variable IEEE390=0 will
   1124       cause the z/OS version of ICU to be built without IEEE floating point
   1125       support and use the native hexadecimal floating point. By default ICU is
   1126       built with IEEE 754 support. Native floating point support is sufficient
   1127       for codepage conversion, resource bundle and UnicodeString operations, but
   1128       the Format APIs require IEEE binary floating point.</li>
   1129 
   1130       <li>z/OS introduced the concept of Extra Performance Linkage (XPLINK) to
   1131       bring performance improvement opportunities to call-intensive C and C++
   1132       applications such as ICU. XPLINK is enabled on a DLL-by-DLL basis, so if
   1133       you are considering using XPLINK in your application that uses ICU, you
   1134       should consider building the XPLINK-enabled version of ICU. You need to
   1135       set ICU's environment variable <code>OS390_XPLINK=1</code> prior to
   1136       invoking the make process to produce binaries that are enabled for
   1137       XPLINK. The XPLINK option, which is available for z/OS 1.2 and later,
   1138       requires the PTF PQ69418 to build XPLINK enabled binaries.</li>
   1139 
   1140       <li>ICU requires XPLINK for the icuio library. If you want to use the
   1141       rest of ICU without XPLINK, then you must use the --disable-icuio
   1142       configure option.</li>
   1143 
   1144       <li>The latest versions of z/OS use <a
   1145       href="https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.cbcux01/oebind6.htm">XPLINK
   1146       version (C128) of the C++ standard library</a> by default. You may see <a
   1147       href="https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.cbcux01/oebind5.htm">an
   1148       error</a> when running with XPLINK disabled. To avoid this error,
   1149       set the following environment variable or similar:
   1150 
   1151 <pre><samp>export _CXX_PSYSIX="CEE.SCEELIB(C128N)":"CBC.SCLBSID(IOSTREAM,COMPLEX)"</samp></pre>
   1152       </li>
   1153 
   1154       <li>When building ICU data, the heap size may need to be increased with the following
   1155       environment variable:
   1156 
   1157 <pre><samp>export _CEE_RUNOPTS="HEAPPOOLS(ON),HEAP(4M,1M,ANY,FREE,0K,4080)"</samp></pre>
   1158       </li>
   1159 
   1160 
   1161       <li>The rest of the instructions for building and testing ICU on z/OS with
   1162       UNIX System Services are the same as the <a href="#HowToBuildUNIX">How To
   1163       Build And Install On UNIX</a> section.</li>
   1164     </ul>
   1165 
   1166     <h4>z/OS (Batch/PDS) support outside the UNIX system services
   1167     environment</h4>
   1168 
   1169     <p>By default, ICU builds its libraries into the UNIX file system (HFS). In
   1170     addition, there is a z/OS specific environment variable (OS390BATCH) to build
   1171     some libraries into the z/OS native file system. This is useful, for example,
   1172     when your application is externalized via Job Control Language (JCL).</p>
   1173 
   1174     <p>The OS390BATCH environment variable enables non-UNIX support including the
   1175     batch environment. When OS390BATCH is set, the libicui18n<i>XX</i>.dll,
   1176     libicuuc<i>XX</i>.dll, and libicudt<i>XX</i>e.dll binaries are built into
   1177     data sets (the native file system). Turning on OS390BATCH does not turn off
   1178     the normal z/OS UNIX build. This means that the z/OS UNIX (HFS) DLLs will
   1179     always be created.</p>
   1180 
   1181     <p>Two additional environment variables indicate the names of the z/OS data
   1182     sets to use. The LOADMOD environment variable identifies the name of the data
   1183     set that contains the dynamic link libraries (DLLs) and the LOADEXP
   1184     environment variable identifies the name of the data set that contains the
   1185     side decks, which are normally the files with the .x suffix in the UNIX file
   1186     system.</p>
   1187 
   1188     <p>A data set is roughly equivalent to a UNIX or Windows file. For most kinds
   1189     of data sets the operating system maintains record boundaries. UNIX and
   1190     Windows files are byte streams. Two kinds of data sets are PDS and PDSE. Each
   1191     data set of these two types contains a directory. It is like a UNIX
   1192     directory. Each "file" is called a "member". Each member name is limited to
   1193     eight bytes, normally EBCDIC.</p>
   1194 
   1195     <p>Here is an example of some environment variables that you can set prior to
   1196     building ICU:</p>
   1197 <pre>
   1198 <samp>OS390BATCH=1
   1199 LOADMOD=<i>USER</i>.ICU.LOAD
   1200 LOADEXP=<i>USER</i>.ICU.EXP</samp>
   1201 </pre>
   1202 
   1203     <p>The PDS member names for the DLL file names are as follows:</p>
   1204 <pre>
   1205 <samp>IXMI<i>XX</i>IN --&gt; libicui18n<i>XX</i>.dll
   1206 IXMI<i>XX</i>UC --&gt; libicuuc<i>XX</i>.dll
   1207 IXMI<i>XX</i>DA --&gt; libicudt<i>XX</i>e.dll</samp>
   1208 </pre>
   1209 
   1210     <p>You should point the LOADMOD environment variable at a partitioned data
   1211     set extended (PDSE) and point the LOADEXP environment variable at a
   1212     partitioned data set (PDS). The PDSE can be allocated with the following
   1213     attributes:</p>
   1214 <pre>
   1215 <samp>Data Set Name . . . : <i>USER</i>.ICU.LOAD
   1216 Management class. . : <i>**None**</i>
   1217 Storage class . . . : <i>BASE</i>
   1218 Volume serial . . . : <i>TSO007</i>
   1219 Device type . . . . : <i>3390</i>
   1220 Data class. . . . . : <i>LOAD</i>
   1221 Organization  . . . : PO
   1222 Record format . . . : U
   1223 Record length . . . : 0
   1224 Block size  . . . . : <i>32760</i>
   1225 1st extent cylinders: 1
   1226 Secondary cylinders : 5
   1227 Data set name type  : LIBRARY</samp>
   1228 </pre>
   1229 
   1230     <p>The PDS can be allocated with the following attributes:</p>
   1231 <pre>
   1232 <samp>Data Set Name . . . : <i>USER</i>.ICU.EXP
   1233 Management class. . : <i>**None**</i>
   1234 Storage class . . . : <i>BASE</i>
   1235 Volume serial . . . : <i>TSO007</i>
   1236 Device type . . . . : <i>3390</i>
   1237 Data class. . . . . : <i>**None**</i>
   1238 Organization  . . . : PO
   1239 Record format . . . : FB
   1240 Record length . . . : 80
   1241 Block size  . . . . : <i>3200</i>
   1242 1st extent cylinders: 3
   1243 Secondary cylinders : 3
   1244 Data set name type  : PDS</samp>
   1245 </pre>
   1246 
   1247     <h3><a name="HowToBuildOS400" href="#HowToBuildOS400" id=
   1248     "HowToBuildOS400">How To Build And Install On The IBM i Family (IBM i, i5/OS OS/400)</a></h3>
   1249 
   1250     <p>Before you start building ICU, ICU requires the following:</p>
   1251 
   1252     <ul>
   1253       <li>QSHELL interpreter installed (install base option 30, operating system)
   1254       <!--li>QShell Utilities, PRPQ 5799-XEH (not required for V4R5)</li--></li>
   1255 
   1256       <li>ILE C/C++ Compiler installed on the system</li>
   1257 
   1258       <li>The latest IBM tools for Developers for IBM i &mdash;
   1259         <a href='https://www-356.ibm.com/partnerworld/wps/servlet/ContentHandler/pw_com_porting_tools_index'>https://www-356.ibm.com/partnerworld/wps/servlet/ContentHandler/pw_com_porting_tools_index</a>
   1260         <!-- formerly http://www.ibm.com/servers/enable/site/porting/tools/'>http://www.ibm.com/servers/enable/site/porting/tools/</a> -->
   1261         <!-- formerly: http://www.ibm.com/servers/enable/site/porting/iseries/overview/gnu_utilities.html -->
   1262       </li>
   1263     </ul>
   1264 
   1265     <p>The following describes how to setup and build ICU. For background
   1266     information, you should look at the <a href="#HowToBuildUNIX">UNIX build
   1267     instructions</a>.</p>
   1268 
   1269     <ol>
   1270       <li>
   1271         Copy the ICU source .tgz to the IBM i environment, as binary.
   1272         Also, copy the <a href='as_is/os400/unpax-icu.sh'>unpax-icu.sh</a> script into the same directory, as a text file.
   1273       </li>
   1274 
   1275       <li>
   1276         Create target library. This library will be the target for the
   1277         resulting modules, programs and service programs. You will specify this
   1278         library on the OUTPUTDIR environment variable.
   1279 <pre>
   1280 <samp>CRTLIB LIB(<i>libraryname</i>)
   1281 ADDENVVAR ENVVAR(OUTPUTDIR) VALUE('<i>libraryname</i>') REPLACE(*YES)   </samp></pre>
   1282       </li>
   1283 
   1284       <li>
   1285       Set up the following environment variables and job characteristics in your build process
   1286 <pre>
   1287 <samp>ADDENVVAR ENVVAR(MAKE) VALUE('gmake') REPLACE(*YES)
   1288 CHGJOB CCSID(37)</samp></pre></li>
   1289 
   1290       <li>Fire up the QSH <i>(all subsequent commands are run inside the qsh session.)</i>
   1291         <pre><samp>qsh</samp></pre>
   1292       </li>
   1293 
   1294       <li>Set up the PATH: <pre><samp>export PATH=/QIBM/ProdData/DeveloperTools/qsh/bin:$PATH:/QOpenSys/usr/bin</samp></pre>
   1295       </li>
   1296 
   1297       <li>Unpack the ICU source code archive:
   1298         <pre><samp>gzip -d icu-<i>X</i>.<i>Y</i>.tgz</samp></pre>
   1299           </li>
   1300 
   1301       <li>Run unpax-icu.sh on the tar file generated from the previous step.
   1302         <pre><samp>unpax-icu.sh icu.tar</samp></pre></li>
   1303 
   1304       <li>Build the program ICULD which ICU will use for linkage.
   1305         <pre><samp>cd icu/as_is/os400
   1306 qsh bldiculd.sh
   1307 cd ../../..</samp></pre>
   1308         </li>
   1309 
   1310       <li>Change into the 'source' directory, and configure ICU.  (See <a href="#HowToConfigureICU">configuration
   1311       note</a> for details). Note that --with-data-packaging=archive and setting the --prefix are recommended, building in default (dll) mode is currently not supported.
   1312         <pre><samp>cd icu/source
   1313 ./runConfigureICU IBMi --prefix=<i>/path/to/somewhere</i> --with-data-packaging=archive</samp></pre>
   1314 </li>
   1315 
   1316       <li>Build ICU. <i>(Note: Do not use the -j option)</i> <pre><samp>gmake</samp></pre></li>
   1317 
   1318       <li>Test ICU. <pre><samp>gmake check</samp></pre>
   1319         (The <tt> QIBM_MULTI_THREADED=Y</tt> flag will be automatically applied to intltest -
   1320           you can look at the <a href=
   1321       "https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzahw/rzahwceeco.htm">
   1322       iSeries Information Center</a> for more details regarding the running of multiple threads
   1323       on IBM i.)</li>
   1324     </ol>
   1325 
   1326       <!-- cross -->
   1327     <h3><a name="HowToCrossCompileICU" href="#HowToCrossCompileICU" id="HowToCrossCompileICU">How To Cross Compile ICU</a></h3>
   1328 		<p>This section will explain how to build ICU on one platform, but to produce binaries intended to run on another. This is commonly known as a cross compile.</p>
   1329 		<p>Normally, in the course of a build, ICU needs to run the tools that it builds in order to generate and package data and test-data.In a cross compilation setting, ICU is built on a different system from that which it eventually runs on. An example might be, if you are building for a small/headless system (such as an embedded device), or a system where you can't easily run the ICU command line tools (any non-UNIX-like system).</p>
   1330 		<p>To reduce confusion, we will here refer to the "A" and the "B" system.System "A" is the actual system we will be running on- the only requirements on it is are it is able to build ICU from the command line targetting itself (with configure or runConfigureICU), and secondly, that it also contain the correct toolchain for compiling and linking for the resultant platform, referred to as the "B" system.</p>
   1331 		<p>The autoconf docs use the term "build" for A, and "host" for B. More details at: <a href="http://www.gnu.org/software/autoconf/manual/html_node/Specifying-Names.html#Specifying-Names">http://www.gnu.org/software/autoconf/manual/html_node/Specifying-Names.html</a></p>
   1332 		<p>Three initially-empty directories will be used in this example:</p>
   1333 		<table summary="Three directories used in this example" class="docTable">
   1334 			<tr>
   1335 				<th align="left">/icu</th><td>a copy of the ICU source</td>
   1336 			</tr>
   1337 			<tr>
   1338 				<th align="left">/buildA</th><td>an empty directory, it will contain ICU built for A<br />(MacOSX in this case)</td>
   1339 			</tr>
   1340 			<tr>
   1341 				<th align="left">/buildB</th><td>an empty directory, it will contain ICU built for B<br />(HaikuOS in this case)</td>
   1342 			</tr>
   1343 		</table>
   1344 
   1345 		<ol>
   1346 		<li>Check out or unpack the ICU source code into the /icu directory.You will have the directories /icu/source, etc.</li>
   1347 		<li>Build ICU in /buildA normally (using runConfigureICU or configure):
   1348 <pre class="samp">cd /buildA
   1349 sh /icu/source/runConfigureICU <strong>MacOSX</strong>
   1350 gnumake
   1351 </pre>
   1352 		</li>
   1353 		<li>Set PATH or other variables as needed, such as CPPFLAGS.</li>
   1354 		<li>Build ICU in /buildB<br />
   1355 			<p class="note">"<code>--with-cross-build</code>" takes an absolute path.</p>
   1356 <pre class="samp">cd /buildB
   1357 sh /icu/source/configure --host=<strong>i586-pc-haiku</strong> --with-cross-build=<strong>/buildA</strong>
   1358 gnumake</pre>
   1359 		</li>
   1360 		<li>Tests and testdata can be built with "gnumake tests".</li>
   1361 	</ol>
   1362       <!-- end cross -->
   1363 
   1364     <!-- end build environment -->
   1365 
   1366     <h2><a name="HowToPackage" href="#HowToPackage" id="HowToPackage">How To
   1367     Package ICU</a></h2>
   1368 
   1369     <p>There are many ways that a person can package ICU with their software
   1370     products. Usually only the libraries need to be considered for packaging.</p>
   1371 
   1372     <p>On UNIX, you should use "<tt>gmake install</tt>" to make it easier to
   1373     develop and package ICU. The bin, lib and include directories are needed to
   1374     develop applications that use ICU. These directories will be created relative
   1375     to the "<tt>--prefix=</tt><i>dir</i>" configure option (See the <a href=
   1376     "#HowToBuildUNIX">UNIX build instructions</a>). When ICU is built on Windows,
   1377     a similar directory structure is built.</p>
   1378 
   1379     <p>When changes have been made to the standard ICU distribution, it is
   1380     recommended that at least one of the following guidelines be followed for
   1381     special packaging.</p>
   1382 
   1383     <ol>
   1384       <li>Add a suffix name to the library names. This can be done with the
   1385       --with-library-suffix configure option.</li>
   1386 
   1387       <li>The installation script should install the ICU libraries into the
   1388       application's directory.</li>
   1389     </ol>
   1390 
   1391     <p>Following these guidelines prevents other applications that use a standard
   1392     ICU distribution from conflicting with any libraries that you need. On
   1393     operating systems that do not have a standard C++ ABI (name mangling) for
   1394     compilers, it is recommended to do this special packaging anyway. More
   1395     details on customizing ICU are available in the <a href=
   1396     "http://userguide.icu-project.org/">User's Guide</a>. The <a href=
   1397     "#SourceCode">ICU Source Code Organization</a> section of this readme.html
   1398     gives a more complete description of the libraries.</p>
   1399 
   1400     <table class="docTable" summary=
   1401     "ICU has several libraries for you to use.">
   1402       <caption>
   1403         Here is an example of libraries that are frequently packaged.
   1404       </caption>
   1405 
   1406       <tr>
   1407         <th scope="col">Library Name</th>
   1408 
   1409         <th scope="col">Windows Filename</th>
   1410 
   1411         <th scope="col">Linux Filename</th>
   1412 
   1413         <th scope="col">Comment</th>
   1414       </tr>
   1415 
   1416       <tr>
   1417         <td>Data Library</td>
   1418 
   1419         <td>icudt<i>XY</i>l.dll</td>
   1420 
   1421         <td>libicudata.so.<i>XY</i>.<i>Z</i></td>
   1422 
   1423         <td>Data required by the Common and I18n libraries. There are many ways
   1424         to package and <a href=
   1425         "http://userguide.icu-project.org/icudata">customize this
   1426         data</a>, but by default this is all you need.</td>
   1427       </tr>
   1428 
   1429       <tr>
   1430         <td>Common Library</td>
   1431 
   1432         <td>icuuc<i>XY</i>.dll</td>
   1433 
   1434         <td>libicuuc.so.<i>XY</i>.<i>Z</i></td>
   1435 
   1436         <td>Base library required by all other ICU libraries.</td>
   1437       </tr>
   1438 
   1439       <tr>
   1440         <td>Internationalization (i18n) Library</td>
   1441 
   1442         <td>icuin<i>XY</i>.dll</td>
   1443 
   1444         <td>libicui18n.so.<i>XY</i>.<i>Z</i></td>
   1445 
   1446         <td>A library that contains many locale based internationalization (i18n)
   1447         functions.</td>
   1448       </tr>
   1449 
   1450       <tr>
   1451         <td>Layout Extensions Engine</td>
   1452 
   1453         <td>iculx<i>XY</i>.dll</td>
   1454 
   1455         <td>libiculx.so.<i>XY</i>.<i>Z</i></td>
   1456 
   1457         <td>An optional engine for doing paragraph layout that uses
   1458         parts of ICU.
   1459         HarfBuzz is required.</td>
   1460       </tr>
   1461 
   1462       <tr>
   1463         <td>ICU I/O (Unicode stdio) Library</td>
   1464 
   1465         <td>icuio<i>XY</i>.dll</td>
   1466 
   1467         <td>libicuio.so.<i>XY</i>.<i>Z</i></td>
   1468 
   1469         <td>An optional library that provides a stdio like API with Unicode
   1470         support.</td>
   1471       </tr>
   1472 
   1473       <tr>
   1474         <td>Tool Utility Library</td>
   1475 
   1476         <td>icutu<i>XY</i>.dll</td>
   1477 
   1478         <td>libicutu.so.<i>XY</i>.<i>Z</i></td>
   1479 
   1480         <td>An internal library that contains internal APIs that are only used by
   1481         ICU's tools. If you do not use ICU's tools, you do not need this
   1482         library.</td>
   1483       </tr>
   1484     </table>
   1485 
   1486     <p>Normally only the above ICU libraries need to be considered for packaging.
   1487     The versionless symbolic links to these libraries are only needed for easier
   1488     development. The <i>X</i>, <i>Y</i> and <i>Z</i> parts of the name are the
   1489     version numbers of ICU. For example, ICU 2.0.2 would have the name
   1490     libicuuc.so.20.2 for the common library. The exact format of the library
   1491     names can vary between platforms due to how each platform can handles library
   1492     versioning.</p>
   1493 
   1494     <h2><a name="ImportantNotes" href="#ImportantNotes" id=
   1495     "ImportantNotes">Important Notes About Using ICU</a></h2>
   1496 
   1497     <h3><a name="ImportantNotesMultithreaded" href="#ImportantNotesMultithreaded"
   1498     id="ImportantNotesMultithreaded">Using ICU in a Multithreaded
   1499     Environment</a></h3>
   1500 
   1501     <p>Some versions of ICU require calling the <code>u_init()</code> function
   1502     from <code>uclean.h</code> to ensure that ICU is initialized properly. In
   1503     those ICU versions, <code>u_init()</code> must be called before ICU is used
   1504     from multiple threads. There is no harm in calling <code>u_init()</code> in a
   1505     single-threaded application, on a single-CPU machine, or in other cases where
   1506     <code>u_init()</code> is not required.</p>
   1507 
   1508     <p>In addition to ensuring thread safety, <code>u_init()</code> also attempts
   1509     to load at least one ICU data file. Assuming that all data files are packaged
   1510     together (or are in the same folder in files mode), a failure code from
   1511     <code>u_init()</code> usually means that the data cannot be found. In this
   1512     case, the data may not be installed properly, or the application may have
   1513     failed to call <code>udata_setCommonData()</code> or
   1514     <code>u_setDataDirectory()</code> which specify to ICU where it can find its
   1515     data.</p>
   1516 
   1517     <p>Since <code>u_init()</code> will load only one or two data files, it
   1518     cannot guarantee that all of the data that an application needs is available.
   1519     It cannot check for all data files because the set of files is customizable,
   1520     and some ICU services work without loading any data at all. An application
   1521     should always check for error codes when opening ICU service objects (using
   1522     <code>ucnv_open()</code>, <code>ucol_open()</code>, C++ constructors,
   1523     etc.).</p>
   1524 
   1525     <h4>ICU 3.4 and later</h4>
   1526 
   1527     <p>ICU 3.4 self-initializes properly for multi-threaded use. It achieves this
   1528     without performance penalty by hardcoding the core Unicode properties data,
   1529     at the cost of some flexibility. (For details see Jitterbug 4497.)</p>
   1530 
   1531     <p><code>u_init()</code> can be used to check for data loading. It tries to
   1532     load the converter alias table (<code>cnvalias.icu</code>).</p>
   1533 
   1534     <h4>ICU 2.6..3.2</h4>
   1535 
   1536     <p>These ICU versions require a call to <code>u_init()</code> before
   1537     multi-threaded use. The services that are directly affected are those that
   1538     don't have a service object and need to be fast: normalization and character
   1539     properties.</p>
   1540 
   1541     <p><code>u_init()</code> loads and initializes the data files for
   1542     normalization and character properties (<code>unorm.icu</code> and
   1543     <code>uprops.icu</code>) and can therefore also be used to check for data
   1544     loading.</p>
   1545 
   1546     <h4>ICU 2.4 and earlier</h4>
   1547 
   1548     <p>ICU 2.4 and earlier versions were not prepared for multithreaded use on
   1549     multi-CPU platforms where the CPUs implement weak memory coherency. These
   1550     CPUs include: Power4, Power5, Alpha, Itanium. <code>u_init()</code> was not
   1551     defined yet.</p>
   1552 
   1553     <h4><a name="ImportantNotesHPUX" href="#ImportantNotesHPUX" id=
   1554     "ImportantNotesHPUX">Using ICU in a Multithreaded Environment on
   1555     HP-UX</a></h4>
   1556 
   1557     <p>When ICU is built with aCC on HP-UX, the <a
   1558     href="http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=eb08b3f1eee02110b3f1eee02110275d6e10RCRD">-AA</a>
   1559     compiler flag is used. It is required in order to use the latest
   1560     &lt;iostream&gt; API in a thread safe manner. This compiler flag affects the
   1561     version of the C++ library being used. Your applications will also need to
   1562     be compiled with -AA in order to use ICU.</p>
   1563 
   1564     <h4><a name="ImportantNotesSolaris" href="#ImportantNotesSolaris" id=
   1565     "ImportantNotesSolaris">Using ICU in a Multithreaded Environment on
   1566     Solaris</a></h4>
   1567 
   1568     <h5>Linking on Solaris</h5>
   1569 
   1570     <p>In order to avoid synchronization and threading issues, developers are
   1571     <strong>suggested</strong> to strictly follow the compiling and linking
   1572     guidelines for multithreaded applications, specified in the following
   1573     SUn Solaris document available from Oracle. Most notably, pay strict attention to the
   1574     following statements from Sun:</p>
   1575 
   1576     <blockquote>
   1577       <p>To use libthread, specify -lthread before -lc on the ld command line, or
   1578       last on the cc command line.</p>
   1579 
   1580       <p>To use libpthread, specify -lpthread before -lc on the ld command line,
   1581       or last on the cc command line.</p>
   1582     </blockquote>
   1583 
   1584     <p>Failure to do this may cause spurious lock conflicts, recursive mutex
   1585     failure, and deadlock.</p>
   1586 
   1587     <p>Source: "<i>Multithreaded Programming Guide, Compiling and
   1588     Debugging</i>", Sun Microsystems, 2002 <br />
   1589      <a href=
   1590     "https://docs.oracle.com/cd/E19683-01/806-6867/compile-74765/index.html">https://docs.oracle.com/cd/E19683-01/806-6867/compile-74765/index.html</a></p>
   1591 
   1592     <p>Note, a version of that chapter from a 2008 document update covering both Solaris 9
   1593     and Solaris 10 is available here:<br />
   1594      <a href=
   1595     "http://docs.oracle.com/cd/E19253-01/816-5137/compile-94179/index.html">http://docs.oracle.com/cd/E19253-01/816-5137/compile-94179/index.html</a></p>
   1596 
   1597     <h3><a name="ImportantNotesWindows" href="#ImportantNotesWindows" id=
   1598     "ImportantNotesWindows">Windows Platform</a></h3>
   1599 
   1600     <p>If you are building on the Win32 platform, it is important that you
   1601     understand a few of the following build details.</p>
   1602 
   1603     <h4>DLL directories and the PATH setting</h4>
   1604 
   1605     <p>As delivered, the International Components for Unicode build as several
   1606     DLLs, which are placed in the "<i>&lt;ICU&gt;</i>\bin" directory. You must
   1607     add this directory to the PATH environment variable in your system, or any
   1608     executables you build will not be able to access International Components for
   1609     Unicode libraries. Alternatively, you can copy the DLL files into a directory
   1610     already in your PATH, but we do not recommend this. You can wind up with
   1611     multiple copies of the DLL and wind up using the wrong one.</p>
   1612 
   1613     <h4><a name="ImportantNotesWindowsPath" id=
   1614     "ImportantNotesWindowsPath">Changing your PATH</a></h4>
   1615 
   1616     <p><strong>Windows 2000/XP</strong>: Use the System Icon in the Control
   1617     Panel. Pick the "Advanced" tab. Select the "Environment Variables..."
   1618     button. Select the variable PATH in the lower box, and select the lower
   1619     "Edit..." button. In the "Variable Value" box, append the string
   1620     ";<i>&lt;ICU&gt;</i>\bin" to the end of the path string. If there is
   1621     nothing there, just type in "<i>&lt;ICU&gt;</i>\bin". Click the Set button,
   1622     then the OK button.</p>
   1623 
   1624     <p>Note: When packaging a Windows application for distribution and
   1625     installation on user systems, copies of the ICU DLLs should be included with
   1626     the application, and installed for exclusive use by the application. This is
   1627     the only way to insure that your application is running with the same version
   1628     of ICU, built with exactly the same options, that you developed and tested
   1629     with. Refer to Microsoft's guidelines on the usage of DLLs, or search for the
   1630     phrase "DLL hell" on <a href=
   1631     "http://msdn.microsoft.com/">msdn.microsoft.com</a>.</p>
   1632 
   1633     <h3><a name="ImportantNotesUNIX" href="#ImportantNotesUNIX" id=
   1634     "ImportantNotesUNIX">UNIX Type Platform</a></h3>
   1635 
   1636     <p>If you are building on a UNIX platform, and if you are installing ICU in a
   1637     non-standard location, you may need to add the location of your ICU libraries
   1638     to your <strong>LD_LIBRARY_PATH</strong> or <strong>LIBPATH</strong>
   1639     environment variable (or the equivalent runtime library path environment
   1640     variable for your system). The ICU libraries may not link or load properly
   1641     without doing this.</p>
   1642 
   1643     <p>Note that if you do not want to have to set this variable, you may instead
   1644     use the --enable-rpath option at configuration time. This option will
   1645     instruct the linker to always look for the libraries where they are
   1646     installed. You will need to use the appropriate linker options when linking
   1647     your own applications and libraries against ICU, too. Please refer to your
   1648     system's linker manual for information about runtime paths. The use of rpath
   1649     also means that when building a new version of ICU you should not have an
   1650     older version installed in the same place as the new version's installation
   1651     directory, as the older libraries will used during the build, instead of the
   1652     new ones, likely leading to an incorrectly build ICU. This is the proper
   1653     behavior of rpath.</p>
   1654 
   1655     <h2><a name="PlatformDependencies" href="#PlatformDependencies" id=
   1656     "PlatformDependencies">Platform Dependencies</a></h2>
   1657 
   1658     <h3><a name="PlatformDependenciesNew" href="#PlatformDependenciesNew" id=
   1659     "PlatformDependenciesNew">Porting To A New Platform</a></h3>
   1660 
   1661     <p>If you are using ICU's Makefiles to build ICU on a new platform, there are
   1662     a few places where you will need to add or modify some files. If you need
   1663     more help, you can always ask the <a href=
   1664     "http://site.icu-project.org/contacts">icu-support mailing list</a>. Once
   1665     you have finished porting ICU to a new platform, it is recommended that you
   1666     contribute your changes back to ICU via the icu-support mailing list. This
   1667     will make it easier for everyone to benefit from your work.</p>
   1668 
   1669     <h4>Data For a New Platform</h4>
   1670 
   1671     <p>For some people, it may not be necessary for completely build ICU. Most of
   1672     the makefiles and build targets are for tools that are used for building
   1673     ICU's data, and an application's data (when an application uses ICU resource
   1674     bundles for its data).</p>
   1675 
   1676     <p>Data files can be built on a different platform when both platforms share
   1677     the same endianness and the same charset family. This assertion does not
   1678     include platform dependent DLLs/shared/static libraries. For details see the
   1679     User Guide <a href="http://userguide.icu-project.org/icudata">ICU
   1680     Data</a> chapter.</p>
   1681 
   1682     <p>ICU 3.6 removes the requirement that ICU be completely built in the native
   1683     operating environment. It adds the icupkg tool which can be run on any
   1684     platform to turn binary ICU data files from any one of the three formats into
   1685     any one of the other data formats. This allows a application to use ICU data
   1686     built anywhere to be used for any other target platform.</p>
   1687 
   1688     <p><strong>WARNING!</strong> Building ICU without running the tests is not
   1689     recommended. The tests verify that ICU is safe to use. It is recommended that
   1690     you try to completely port and test ICU before using the libraries for your
   1691     own application.</p>
   1692 
   1693     <h4>Adapting Makefiles For a New Platform</h4>
   1694 
   1695     <p>Try to follow the build steps from the <a href="#HowToBuildUNIX">UNIX</a>
   1696     build instructions. If the configure script fails, then you will need to
   1697     modify some files. Here are the usual steps for porting to a new
   1698     platform:<br />
   1699     </p>
   1700 
   1701     <ol>
   1702       <li>Create an mh file in icu/source/config/. You can use mh-linux or a
   1703       similar mh file as your base configuration.</li>
   1704 
   1705       <li>Modify icu/source/aclocal.m4 to recognize your platform's mh file.</li>
   1706 
   1707       <li>Modify icu/source/configure.in to properly set your <b>platform</b> C
   1708       Macro define.</li>
   1709 
   1710       <li>Run <a href="http://www.gnu.org/software/autoconf/">autoconf</a> in
   1711       icu/source/ without any options. The autoconf tool is standard on most
   1712       Linux systems.</li>
   1713 
   1714       <li>If you have any optimization options that you want to normally use, you
   1715       can modify icu/source/runConfigureICU to specify those options for your
   1716       platform.</li>
   1717 
   1718       <li>Build and test ICU on your platform. It is very important that you run
   1719       the tests. If you don't run the tests, there is no guarentee that you have
   1720       properly ported ICU.</li>
   1721     </ol>
   1722 
   1723     <h3><a name="PlatformDependenciesImpl" href="#PlatformDependenciesImpl" id=
   1724     "PlatformDependenciesImpl">Platform Dependent Implementations</a></h3>
   1725 
   1726     <p>The platform dependencies have been mostly isolated into the following
   1727     files in the common library. This information can be useful if you are
   1728     porting ICU to a new platform.</p>
   1729 
   1730     <ul>
   1731       <li>
   1732         <strong>unicode/platform.h.in</strong> (autoconf'ed platforms)<br />
   1733          <strong>unicode/p<i>XXXX</i>.h</strong> (others: pwin32.h, ppalmos.h,
   1734         ..): Platform-dependent typedefs and defines:<br />
   1735         <br />
   1736 
   1737 
   1738         <ul>
   1739           <li>Generic types like UBool, int8_t, int16_t, int32_t, int64_t,
   1740           uint64_t etc.</li>
   1741 
   1742           <li>U_EXPORT and U_IMPORT for specifying dynamic library import and
   1743           export</li>
   1744 
   1745           <li>String handling support for the char16_t and wchar_t types.</li>
   1746         </ul>
   1747         <br />
   1748       </li>
   1749 
   1750       <li>
   1751         <strong>unicode/putil.h, putil.c</strong>: platform-dependent
   1752         implementations of various functions that are platform dependent:<br />
   1753         <br />
   1754 
   1755 
   1756         <ul>
   1757           <li>uprv_isNaN, uprv_isInfinite, uprv_getNaN and uprv_getInfinity for
   1758           handling special floating point values.</li>
   1759 
   1760           <li>uprv_tzset, uprv_timezone, uprv_tzname and time for getting
   1761           platform specific time and time zone information.</li>
   1762 
   1763           <li>u_getDataDirectory for getting the default data directory.</li>
   1764 
   1765           <li>uprv_getDefaultLocaleID for getting the default locale
   1766           setting.</li>
   1767 
   1768           <li>uprv_getDefaultCodepage for getting the default codepage
   1769           encoding.</li>
   1770         </ul>
   1771         <br />
   1772       </li>
   1773 
   1774       <li>
   1775         <strong>umutex.h, umutex.c</strong>: Code for doing synchronization in
   1776         multithreaded applications. If you wish to use International Components
   1777         for Unicode in a multithreaded application, you must provide a
   1778         synchronization primitive that the classes can use to protect their
   1779         global data against simultaneous modifications. We already supply working
   1780         implementations for many platforms that ICU builds on.<br />
   1781         <br />
   1782       </li>
   1783 
   1784       <li><strong>umapfile.h, umapfile.c</strong>: functions for mapping or
   1785       otherwise reading or loading files into memory. All access by ICU to data
   1786       from files makes use of these functions.<br />
   1787       <br />
   1788       </li>
   1789 
   1790       <li>Using platform specific #ifdef macros are highly discouraged outside of
   1791       the scope of these files. When the source code gets updated in the future,
   1792       these #ifdef's can cause testing problems for your platform.</li>
   1793     </ul>
   1794     <hr />
   1795     <p> Copyright &copy; 2016 and later: Unicode, Inc. and others. License &amp; terms of use:
   1796     <a href="http://www.unicode.org/copyright.html">http://www.unicode.org/copyright.html</a><br/>
   1797     Copyright &copy; 1997-2016 International Business Machines Corporation and  others.
   1798     All Rights Reserved.</p>
   1799   </body>
   1800 </html>
   1801