• Home
Name Date Size #Lines LOC

..--

as_is/12-May-2024-746482

packaging/12-May-2024-492366

source/12-May-2024-5,071,2504,698,770

APIChangeReport.htmlD12-May-2024176.2 KiB2,5942,590

APIChangeReport.mdD12-May-202486.9 KiB877841

BUILD.gnD12-May-202429.2 KiB680662

LICENSED12-May-202420.5 KiB415387

README.OpenSourceD12-May-2024482 1110

icu4c.cssD12-May-20247.1 KiB516417

license.htmlD12-May-2024622 1916

readme.htmlD12-May-202488.1 KiB1,9151,516

README.OpenSource

1[
2  {
3    "Name": "International Components for Unicode",
4    "License": "ICU License, BSD 3-Clause License",
5    "License File": "LICENSE",
6    "Version Number": "67.1",
7    "Upstream URL": "https://github.com/unicode-org/icu/archive/release-67-1.tar.gz",
8    "Description": "ICU is a mature, widely used set of portable C/C++ and Java libraries for Unicode support, software internationalization and globalization (i18n/g11n). The packages are mirrors of the main website."
9  }
10]
11

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 67.1</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 class="rc"> -->
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      <span class="only-milestone">(Preview Release)</span>
36      <abbr title="International Components for Unicode">ICU</abbr> 67.1 ReadMe
37    </h1>
38
39    <!-- Most of the time we shouldn't need to comment/uncomment this paragraph, just change the body class -->
40    <!-- <p class="note only-milestone">This is a development milestone release of ICU
41      This milestone is intended for those wishing to get an early look at new features and API changes.
42      It is not recommended for production use.</p> -->
43    <p class="note only-milestone">This is a preview release of ICU.
44      It is not recommended for production use.</p>
45
46    <!-- Shouldn't need to comment/uncomment this paragraph, just change the body class -->
47    <p class="note only-rc">This is a release candidate version of ICU4C.
48      It is not recommended for production use.</p>
49
50    <p>Last updated: 2020-Mar-25<br/>
51      Copyright &copy; 2016 and later: Unicode, Inc. and others. License &amp; terms of use:
52      <a href="http://www.unicode.org/copyright.html">http://www.unicode.org/copyright.html</a><br/>
53      Copyright &copy; 1997-2016 International Business Machines Corporation and others.
54      All Rights Reserved.</p>
55    <!-- Remember that there is a copyright at the end too -->
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/67">ICU 67 download page</a>
240    for more information on this release, including any other changes, 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>GitHub 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 clone and checkout the code from our GitHub 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 complete ICU source code from <a
373          href="http://site.icu-project.org/repository">the ICU repository</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 (ICU 61 and later):</b>
558        Since ICU 61, call sites need to qualify ICU types explicitly,
559        for example <code>icu::UnicodeString</code>,
560        or do <code>using icu::UnicodeString;</code> where appropriate.
561        If your code relies on the "using namespace icu;" that used to be in unicode/uversion.h,
562        then you need to update your code.<br />
563        You could temporarily (until you have more time to update your code)
564        revert to the default "using"
565        via <code>-DU_USING_ICU_NAMESPACE=1</code>
566        or by modifying unicode/uversion.h:
567<pre>Index: icu4c/source/common/unicode/uversion.h
568===================================================================
569--- icu4c/source/common/unicode/uversion.h      (revision 40704)
570+++ icu4c/source/common/unicode/uversion.h      (working copy)
571@@ -127,7 +127,7 @@
572                 defined(U_LAYOUTEX_IMPLEMENTATION) || defined(U_TOOLUTIL_IMPLEMENTATION)
573 #           define U_USING_ICU_NAMESPACE 0
574 #       else
575-#           define U_USING_ICU_NAMESPACE 0
576+#           define U_USING_ICU_NAMESPACE 1
577 #       endif
578 #   endif
579 #   if U_USING_ICU_NAMESPACE
580</pre>
581      </li>
582      <li><b>Namespace (ICU 60 and earlier):</b> By default, unicode/uversion.h has
583        "using namespace icu;" which defeats much of the purpose of the namespace.
584        (This is for historical reasons: Originally, ICU4C did not use namespaces,
585        and some compilers did not support them. The default "using" statement
586        preserves source code compatibility.)<br />
587        You should turn this off
588         via <code>-DU_USING_ICU_NAMESPACE=0</code>
589        or by modifying unicode/uversion.h:
590<pre>Index: source/common/unicode/uversion.h
591===================================================================
592--- source/common/unicode/uversion.h    (revision 26606)
593+++ source/common/unicode/uversion.h    (working copy)
594@@ -180,7 +180,8 @@
595 #   define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
596
597 #   ifndef U_USING_ICU_NAMESPACE
598-#       define U_USING_ICU_NAMESPACE 1
599+        // Set to 0 to force namespace declarations in ICU usage.
600+#       define U_USING_ICU_NAMESPACE 0
601 #   endif
602 #   if U_USING_ICU_NAMESPACE
603         U_NAMESPACE_USE
604</pre>
605        ICU call sites then either qualify ICU types explicitly,
606        for example <code>icu::UnicodeString</code>,
607        or do <code>using icu::UnicodeString;</code> where appropriate.</li>
608      <li><b>Hardcode the default charset to UTF-8:</b> On platforms where
609        the default charset is always UTF-8,
610        like MacOS X and some Linux distributions,
611        we recommend hardcoding ICU's default charset to UTF-8.
612        This means that some implementation code becomes simpler and faster,
613        and statically linked ICU libraries become smaller.
614        (See the <a href="http://icu-project.org/apiref/icu4c/platform_8h.html#a0a33e1edf3cd23d9e9c972b63c9f7943">U_CHARSET_IS_UTF8</a>
615        API documentation for more details.)<br />
616        You can <code>-DU_CHARSET_IS_UTF8=1</code> or
617        modify unicode/utypes.h (in ICU 4.8 and below)
618        or modify unicode/platform.h (in ICU 49 and higher):
619<pre>Index: source/common/unicode/utypes.h
620===================================================================
621--- source/common/unicode/utypes.h      (revision 26606)
622+++ source/common/unicode/utypes.h      (working copy)
623@@ -160,7 +160,7 @@
624  * @see UCONFIG_NO_CONVERSION
625  */
626 #ifndef U_CHARSET_IS_UTF8
627-#   define U_CHARSET_IS_UTF8 0
628+#   define U_CHARSET_IS_UTF8 1
629 #endif
630
631 /*===========================================================================*/
632</pre></li>
633      <li><b>UnicodeString constructors:</b> The UnicodeString class has
634        several single-argument constructors that are not marked "explicit"
635        for historical reasons.
636        This can lead to inadvertent construction of a <code>UnicodeString</code>
637        with a single character by using an integer,
638        and it can lead to inadvertent dependency on the conversion framework
639        by using a C string literal.<br />
640        Beginning with ICU 49, you should do the following:
641        <ul>
642          <li>Consider marking the from-<code>UChar</code>
643            and from-<code>UChar32</code> constructors explicit via
644            <code>-DUNISTR_FROM_CHAR_EXPLICIT=explicit</code> or similar.</li>
645          <li>Consider marking the from-<code>const char*</code> and
646            from-<code>const UChar*</code> constructors explicit via
647            <code>-DUNISTR_FROM_STRING_EXPLICIT=explicit</code> or similar.</li>
648        </ul>
649        Note: The ICU test suites cannot be compiled with these settings.
650      </li>
651      <li><b>utf.h, utf8.h, utf16.h, utf_old.h:</b>
652        By default, utypes.h (and thus almost every public ICU header)
653        includes all of these header files.
654        Often, none of them are needed, or only one or two of them.
655        All of utf_old.h is deprecated or obsolete.<br />
656        Beginning with ICU 49,
657        you should define <code>U_NO_DEFAULT_INCLUDE_UTF_HEADERS</code> to 1
658        (via -D or uconfig.h, as above)
659        and include those header files explicitly that you actually need.<br />
660        Note: The ICU test suites cannot be compiled with this setting.</li>
661      <li><b>utf_old.h:</b>
662        All of utf_old.h is deprecated or obsolete.<br />
663        Beginning with ICU 60,
664        you should define <code>U_HIDE_OBSOLETE_UTF_OLD_H</code> to 1
665        (via -D or uconfig.h, as above).
666        Use of any of these macros should be replaced as noted
667        in the comments for the obsolete macro.<br />
668        Note: The ICU test suites <i>can</i> be compiled with this setting.</li>
669      <li><b>.dat file:</b> By default, the ICU data is built into
670        a shared library (DLL). This is convenient because it requires no
671        install-time or runtime configuration,
672        but the library is platform-specific and cannot be modified.
673        A .dat package file makes the opposite trade-off:
674        Platform-portable (except for endianness and charset family, which
675        can be changed with the icupkg tool)
676        and modifiable (also with the icupkg tool).
677        If a path is set, then single data files (e.g., .res files)
678        can be copied to that location to provide new locale data
679        or conversion tables etc.<br />
680        The only drawback with a .dat package file is that the application
681        needs to provide ICU with the file system path to the package file
682        (e.g., by calling <code>u_setDataDirectory()</code>)
683        or with a pointer to the data (<code>udata_setCommonData()</code>)
684        before other ICU API calls.
685        This is usually easy if ICU is used from an application where
686        <code>main()</code> takes care of such initialization.
687        It may be hard if ICU is shipped with
688        another shared library (such as the Xerces-C++ XML parser)
689        which does not control <code>main()</code>.<br />
690        See the <a href="http://userguide.icu-project.org/icudata">User Guide ICU Data</a>
691        chapter for more details.<br />
692        If possible, we recommend building the .dat package.
693        Specify <code>--with-data-packaging=archive</code>
694        on the configure command line, as in<br />
695        <code>runConfigureICU Linux --with-data-packaging=archive</code><br />
696        (Read the configure script's output for further instructions.
697        On Windows, the Visual Studio build generates both the .dat package
698        and the data DLL.)<br />
699        Be sure to install and use the tiny stubdata library
700        rather than the large data DLL.</li>
701      <li><b>Static libraries:</b> It may make sense to build the ICU code
702        into static libraries (.a) rather than shared libraries (.so/.dll).
703        Static linking reduces the overall size of the binary by removing
704        code that is never called.<br />
705        Example configure command line:<br />
706        <code>runConfigureICU Linux --enable-static --disable-shared</code></li>
707      <li><b>Out-of-source build:</b> It is usually desirable to keep the ICU
708        source file tree clean and have build output files written to
709        a different location. This is called an "out-of-source build".
710        Simply invoke the configure script from the target location:
711<pre>~/icu$ git clone export https://github.com/unicode-org/icu.git
712~/icu$ mkdir icu4c-build
713~/icu$ cd icu4c-build
714~/icu/icu4c-build$ ../icu/icu4c/source/runConfigureICU Linux
715~/icu/icu4c-build$ make check</pre><br/>
716        (Note: this example shows a relative path to
717         <code>runConfigureICU</code>. If you experience difficulty,
718         try using an absolute path to <code>runConfigureICU</code>
719         instead.)
720      </li>
721    </ul>
722    <h4>ICU as a System-Level Library</h4>
723    <p>If ICU is installed as a system-level library, there are further
724      opportunities and restrictions to consider.
725      For details, see the <em>Using ICU as an Operating System Level Library</em>
726      section of the <a href="http://userguide.icu-project.org/design">User Guide ICU Architectural Design</a> chapter.</p>
727    <ul>
728      <li><b>Data path:</b> For a system-level library, it is best to load
729        ICU data from the .dat package file because the file system path
730        to the .dat package file can be hardcoded. ICU will automatically set
731        the path to the final install location using U_ICU_DATA_DEFAULT_DIR.
732        Alternatively, you can set <code>-DICU_DATA_DIR=/path/to/icu/data</code>
733        when building the ICU code. (Used by source/common/putil.c.)<br/>
734        Consider also setting <code>-DICU_NO_USER_DATA_OVERRIDE</code>
735        if you do not want the "ICU_DATA" environment variable to be used.
736        (An application can still override the data path via
737        <code>u_setDataDirectory()</code> or
738        <code>udata_setCommonData()</code>.</li>
739      <li><b>Hide draft API:</b> API marked with <code>@draft</code>
740        is new and not yet stable. Applications must not rely on unstable
741        APIs from a system-level library.
742        Define <code>U_HIDE_DRAFT_API</code>, <code>U_HIDE_INTERNAL_API</code>
743        and <code>U_HIDE_SYSTEM_API</code>
744        by modifying unicode/utypes.h before installing it.</li>
745      <li><b>Only C APIs:</b> Applications must not rely on C++ APIs from a
746        system-level library because binary C++ compatibility
747        across library and compiler versions is very hard to achieve.
748        Most ICU C++ APIs are in header files that contain a comment with
749        <code>\brief C++ API</code>.
750        Consider not installing these header files, or define <code>U_SHOW_CPLUSPLUS_API</code>
751        to be <code>0</code> by modifying unicode/utypes.h before installing it.</li>
752      <li><b>Disable renaming:</b> By default, ICU library entry point names
753        have an ICU version suffix. Turn this off for a system-level installation,
754        to enable upgrading ICU without breaking applications. For example:<br />
755        <code>runConfigureICU Linux --disable-renaming</code><br />
756        The public header files from this configuration must be installed
757        for applications to include and get the correct entry point names.</li>
758    </ul>
759
760    <h3><a name="UserConfig" href="#UserConfig" id="UserConfig">User-Configurable Settings</a></h3>
761    <p>ICU4C can be customized via a number of user-configurable settings.
762    Many of them are controlled by preprocessor macros which are
763    defined in the <code>source/common/unicode/uconfig.h</code> header file.
764    Some turn off parts of ICU, for example conversion or collation,
765    trading off a smaller library for reduced functionality.
766    Other settings are recommended (see previous section)
767    but their default values are set for better source code compatibility.</p>
768
769    <p>In order to change such user-configurable settings, you can
770    either modify the <code>uconfig.h</code> header file by adding
771    a specific <code>#define ...</code> for one or more of the macros
772    before they are first tested,
773    or set the compiler's preprocessor flags (<code>CPPFLAGS</code>) to include
774    an equivalent <code>-D</code> macro definition.</p>
775
776    <h3><a name="HowToBuildWindows" href="#HowToBuildWindows" id=
777    "HowToBuildWindows">How To Build And Install On Windows</a></h3>
778
779    <p>Building International Components for Unicode requires:</p>
780
781    <ul>
782      <li>Microsoft Windows</li>
783
784      <li>Microsoft Visual C++ (part of <a href="https://www.visualstudio.com/">Visual Studio</a>) (from either Visual Studio 2015 or Visual Studio 2017)</li>
785
786      <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>
787    </ul>
788        <p class="note"><a href="#HowToBuildCygwin">Cygwin</a> is required if using a version of MSVC other than the one
789        compatible with the supplied project files or if other compilers are used to build ICU. (e.g. GCC)</p>
790
791    <p>The steps are:</p>
792
793    <ol>
794      <li>Unzip the <tt>icu-XXXX.zip</tt> file into any convenient location.<br/>
795        <ul class="no-left-margin">
796          <li>You can use the built-in zip functionality of Windows Explorer to do this.
797          Right-click on the .zip file and choose the "Extract All" option from the context menu.
798          This will open a new window where you can choose the output location to put the files.</li>
799          <li>Alternatively, you can use a 3<sup>rd</sup> party GUI tool like 7-Zip or WinZip to do this as well.</li>
800        </ul>
801      </li>
802
803      <li>Be sure that the ICU binary directory, (ex: <i>&lt;ICU&gt;</i><tt>\bin\</tt>), is
804      included in the <strong>PATH</strong> environment variable. The tests will
805      not work without the location of the ICU DLL files in the path.
806      Note that the binary directory name can depend on what architecture you select when you compile ICU.
807      For x86 or 32-bit builds, the binary directory is "<tt>bin</tt>". Whereas for x64 or 64-bit builds
808      the binary directory is "<tt>bin64</tt>".
809      </li>
810
811      <li>Open the "<i>&lt;ICU&gt;</i><tt>\source\allinone\allinone.sln</tt>" solution
812      file in 'Visual Studio 2017'. (This solution includes all the
813      International Components for Unicode libraries, necessary ICU building
814      tools, and the test suite projects). Please see the
815      <a href="#HowToBuildWindowsCommandLine">command line note below</a> if you want to
816      build from the command line instead.</li>
817
818      <li>If you are building using 'Visual Studio 2015' instead, or if you are building the UWP projects and you have a different
819      version of the Windows 10 SDK installed you will first need to modify the two "<tt>Build.Windows.*.props</tt>" files
820      in the "<tt>allinone</tt>" directory before you can open the "allinone" solution file.
821      Please see the notes below about <a href="#HowToUseOtherVSVersions">building with other versions of Visual Studio</a> and the
822      notes on <a href="#HowToRetargetTheWin10SDK">re-targeting the Windows 10 SDK for the UWP projects</a> for details. Alternatively,
823      you can <a href="#HowToSkipBuildingUWP">skip building the UWP projects</a> entirely as well.
824      </li>
825
826      <li>Set the active platform to "Win32" or "x64" (See <a href="#HowToBuildWindowsPlatform">Windows platform note</a> below)
827      and configuration to "Debug" or "Release" (See <a href="#HowToBuildWindowsConfig">Windows configuration note</a> below).</li>
828
829      <li>Choose the "Build" menu and select "Rebuild Solution". If you want to
830      build the Debug and Release at the same time, see the <a href=
831      "#HowToBuildWindowsBatch">batch configuration note</a> below.</li>
832
833      <li>Run the tests. They can be run from the command line or from within Visual Studio.
834
835        <h4>Running the Tests from the Windows Command Line (cmd)</h4>
836        <ul>
837          <li>The general syntax is:<br />
838              <div class="indent">
839                <tt><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat  <i>Platform</i> <i>Configuration</i></tt>
840              </div>
841          </li>
842          <li>So, for example for x86 (32-bit) and Debug, use the following:<br />
843              <samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat  <b>x86</b> <b>Debug</b></samp>
844              For x86 (32-bit) and Release:
845              <samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat  <b>x86</b> <b>Release</b></samp>
846              For x64 (64-bit) and Debug:
847              <samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat  <b>x64</b> <b>Debug</b></samp>
848              For x64 (64-bit) and Release:
849              <samp><i>&lt;ICU&gt;</i>\source\allinone\icucheck.bat  <b>x64</b> <b>Release</b></samp>
850          </li>
851        </ul>
852
853        <h4>Running the Tests from within Visual Studio</h4>
854
855        <ol>
856          <li>Run the C++ test suite, "<tt>intltest</tt>". To do this: set the active startup
857          project to "intltest", and press Ctrl+F5 to run it. Make sure that it
858          passes without any errors.</li>
859
860          <li>Run the C test suite, "<tt>cintltst</tt>". To do this: set the active startup
861          project to "cintltst", and press Ctrl+F5 to run it. Make sure that it
862          passes without any errors.</li>
863
864          <li>Run the I/O test suite, "<tt>iotest</tt>". To do this: set the active startup
865          project to "iotest", and press Ctrl+F5 to run it. Make sure that it passes
866          without any errors.</li>
867        </ol>
868	    </li>
869
870      <li>You are now able to develop applications with ICU by using the
871      libraries and tools in <tt><i>&lt;ICU&gt;</i>\bin\</tt>. The headers are in
872      <tt><i>&lt;ICU&gt;</i>\include\</tt> and the link libraries are in
873      <tt><i>&lt;ICU&gt;</i>\lib\</tt>. To install the ICU runtime on a machine, or ship
874      it with your application, copy the needed components from
875      <tt><i>&lt;ICU&gt;</i>\bin\</tt> to a location on the system PATH or to your
876      application directory.</li>
877    </ol>
878
879    <p><a name="HowToUseOtherVSVersions" id="HowToUseOtherVSVersions">
880    <strong>Building with other versions of Visual Studio Note:</strong></a>
881    The particular version of the MSVC compiler tool-set (and thus the corresponding version of Visual Studio) that
882    is used to compile ICU is determined by the "<tt>PlatformToolset</tt>" property. This property is stored in two
883    different shared files that are used to set common configuration settings amongst the various ICU "<tt>*.vcxproj</tt>" project files.
884
885    For the non-UWP projects, this setting is in the shared file called "<tt>Build.Windows.ProjectConfiguration.props</tt>" located
886    in the "allinone" directory.
887
888    For the UWP projects, this setting is in the shared file called "<tt>Build.Windows.UWP.ProjectConfiguration.props</tt>", also
889    located in the "allinone" directory.
890    <br/>
891    The value of <tt>v140</tt> corresponds to the Visual Studio 2015 compiler tool set, whereas the value of
892    <tt>v141</tt> corresponds to the Visual Studio 2017 compiler tool set.
893
894    <br/>In order to build the non-UWP projects with Visual Studio 2015 you will need to modify the file
895    called "<tt>Build.Windows.ProjectConfiguration.props</tt>" to change the value of the <tt>PlatformToolset</tt> property.
896
897    Note however that Visual Studio 2017 is required for building the UWP projects.
898    </p>
899
900    <p>Please consider: Using older versions of the MSVC compiler is generally not recommended due to the improved support for the C++11 standard
901    in newer versions of the compiler.</p>
902
903    <p><a name="HowToRetargetTheWin10SDK" id="HowToRetargetTheWin10SDK">
904    <strong>Re-targeting the Windows 10 SDK for the UWP projects Note:</strong></a>
905
906      If the version of the Windows 10 SDK that you have installed does not match the version used by the UWP projects, then you
907      will need to "retarget" them to use the version of the SDK that you have installed instead.
908
909      There are two ways to do this:
910      <ul>
911        <li>In Visual Studio you can right-click on the UWP projects in the 'Solution Explorer' and select the
912            option 'Retarget Projects' from the context menu. This will open up a window where you can select the
913            SDK version to target from a drop-down list of the various SDKs that are installed on the machine.</li>
914
915        <li>Alternatively, you can manually edit the shared file called "<tt>Build.Windows.UWP.ProjectConfiguration.props</tt>"
916            which is located in the "allinone" directory. You will need to change the of the
917            "<tt>WindowsTargetPlatformVersion</tt>" property to the version of the SDK that you would like to use instead.</li>
918      </ul>
919    </p>
920
921    <p><a name="HowToBuildWindowsCommandLine" id=
922    "HowToBuildWindowsCommandLine"><strong>Using MSBUILD At The Command Line Note:</strong></a>
923    You can build ICU from the command line instead of using the Visual Studio GUI.
924
925    Assuming that you have properly installed Visual Studio to support command line building, you
926    should have a shortcut for the "Developer Command Prompt" listed in the Start Menu.
927    (For Visual Studio 2017 you will need to install the "Desktop development with C++" option).</p>
928
929    <ul>
930      <li>Open the "Developer Command Prompt" shortcut from the Start Menu. (This will open up a new command line window).</li>
931      <li>From within the "Developer Command Prompt" change directory (<tt>cd</tt>) to the ICU source directory.</li>
932      <li>You can then use either '<tt>msbuild</tt>' directly, or you can use the '<tt>devenv.com</tt>' command to build ICU.</li>
933      <li>Using <tt>MSBUILD</tt>:</li>
934      <ul class="no-left-margin">
935        <li>To build the 32-bit Debug version, use the following command line:<br/>
936          <code>'msbuild source\allinone\allinone.sln /p:Configuration=Debug /p:Platform=Win32'</code>.</li>
937        <li>To build the 64-bit Release version, use the following command line:<br/>
938          <code>'msbuild source\allinone\allinone.sln /p:Configuration=Release /p:Platform=x64'</code>.</li>
939      </ul>
940      <li>Using <tt>devenv.com</tt>:</li>
941      <ul class="no-left-margin">
942        <li>To build the 32-bit Debug version, use the following command line:<br/>
943          <code>'devenv.com source\allinone\allinone.sln /build "Debug|Win32"'</code>.</li>
944        <li>To build the 64-bit Release version, use the following command line:<br/>
945          <code>'devenv.com source\allinone\allinone.sln /build "Release|x64"'</code>.</li>
946      </ul>
947    </ul>
948
949    <p><a name="HowToSkipBuildingUWP" id=
950      "HowToSkipBuildingUWP"><strong>Skipping the UWP Projects on the Command Line Note:</strong></a>
951      You can skip (or omit) building the UWP projects on the command line by passing the argument
952      '<code>SkipUWP=true</code>' to either MSBUILD or devenv.</p>
953
954      <ul>
955        <li>For example, using <tt>MSBUILD</tt>:</li>
956        <ul class="no-left-margin">
957          <li>To skip building the UWP projects with a 32-bit Debug build, use the following command line:<br/>
958            <code>'msbuild source\allinone\allinone.sln /p:Configuration=Debug /p:Platform=Win32 /p:SkipUWP=true'</code>.</li>
959          <li>To skip building the UWP projects with a 64-bit Release version, use the following command line:<br/>
960            <code>'msbuild source\allinone\allinone.sln /p:Configuration=Release /p:Platform=x64 /p:SkipUWP=true'</code>.</li>
961        </ul>
962      </ul>
963
964    <p>You can also use Cygwin with the MSVC compiler to build ICU, and you can refer to the <a href=
965    "#HowToBuildCygwin">How To Build And Install On Windows with Cygwin</a>
966    section for more details.</p>
967
968    <p><a name="HowToBuildWindowsPlatform" id=
969    "HowToBuildWindowsPlatform"><strong>Setting Active Platform
970    Note:</strong></a> Even though you are able to select "x64" as the active platform, if your operating system is
971    not a 64 bit version of Windows, the build will fail. To set the active platform, two different possibilities are:</p>
972
973    <ul>
974      <li>Choose "Build" menu, select "Configuration Manager...", and select
975      "Win32" or "x64" for the Active Platform Solution.</li>
976
977      <li>Another way is to select the desired build configuration from "Solution
978      Platforms" dropdown menu from the standard toolbar. It will say
979      "Win32" or "x64" in the dropdown list.</li>
980    </ul>
981
982    <p><a name="HowToBuildWindowsConfig" id=
983    "HowToBuildWindowsConfig"><strong>Setting Active Configuration
984    Note:</strong></a> To set the active configuration, two different
985    possibilities are:</p>
986
987    <ul>
988      <li>Choose "Build" menu, select "Configuration Manager...", and select
989      "Release" or "Debug" for the Active Configuration Solution.</li>
990
991      <li>Another way is to select the desired build configuration from "Solution
992      Configurations" dropdown menu from the standard toolbar. It will say
993      "Release" or "Debug" in the dropdown list.</li>
994    </ul>
995
996    <p><a name="HowToBuildWindowsBatch" id="HowToBuildWindowsBatch"><strong>Batch
997    Configuration Note:</strong></a> If you want to build the Win32 and x64 platforms and
998    Debug and Release configurations at the same time, choose "Build" menu, and select "Batch
999    Build...". Click the "Select All" button, and then click the "Rebuild"
1000    button.</p>
1001
1002    <h3><a name="HowToBuildCygwin" href="#HowToBuildCygwin" id=
1003    "HowToBuildCygwin">How To Build And Install On Windows with Cygwin</a></h3>
1004
1005    <p>Building International Components for Unicode with this configuration
1006    requires:</p>
1007
1008    <ul>
1009      <li>Microsoft Windows</li>
1010
1011      <li>Microsoft Visual C++ (from Visual Studio 2015 or newer, when gcc isn't used).</li>
1012
1013      <li>
1014        Cygwin with the following installed:
1015
1016        <ul>
1017          <li>bash</li>
1018
1019          <li>GNU make</li>
1020
1021          <li>ar</li>
1022
1023          <li>ranlib</li>
1024
1025          <li>man (if you plan to look at the man pages)</li>
1026        </ul>
1027      </li>
1028    </ul>
1029
1030    <p>There are two ways you can build ICU with Cygwin. You can build with gcc
1031    or Microsoft Visual C++. If you use gcc, the resulting libraries and tools
1032    will depend on the Cygwin environment. If you use Microsoft Visual C++, the
1033    resulting libraries and tools do not depend on Cygwin and can be more easily
1034    distributed to other Windows computers (the generated man pages and shell
1035    scripts still need Cygwin). To build with gcc, please follow the "<a href=
1036    "#HowToBuildUNIX">How To Build And Install On UNIX</a>" instructions, while
1037    you are inside a Cygwin bash shell. To build with Microsoft Visual C++,
1038    please use the following instructions:</p>
1039
1040    <ol>
1041      <li>Start the Windows "Command Prompt" window. This is different from the
1042      gcc build, which requires the Cygwin Bash command prompt. The Microsoft
1043      Visual C++ compiler will not work with a bash command prompt.</li>
1044
1045      <li>If the computer isn't set up to use Visual C++ from the command line,
1046      you need to run vcvars32.bat.<br />For example:<br />
1047      "<tt>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat</tt>"
1048      can be used for 32-bit builds <strong>or</strong> <br />
1049      "<tt>C:\Program Files (x86)\Microsoft Visual Studio 14\VC\bin\x86_amd64\vcvarsx86_amd64.bat</tt>"
1050      can be used for 64-bit builds on Windows x64.</li>
1051
1052      <li>Unzip the icu-XXXX.zip file into any convenient location. Using command
1053      line zip, type "unzip -a icu-XXXX.zip -d drive:\directory", or just use
1054      WinZip.</li>
1055
1056      <li>Change directory to "icu/source", which is where you unzipped ICU.</li>
1057
1058      <li>Run "<tt>bash <a href="source/runConfigureICU">./runConfigureICU</a>
1059      Cygwin/MSVC</tt>" (See <a href="#HowToWindowsConfigureICU">Windows
1060      configuration note</a> and non-functional configure options below).</li>
1061
1062      <li>Type <tt>"make"</tt> to compile the libraries and all the data files.
1063      This make command should be GNU make.</li>
1064
1065      <li>Optionally, type <tt>"make check"</tt> to run the test suite, which
1066      checks for ICU's functionality integrity (See <a href=
1067      "#HowToTestWithoutGmake">testing note</a> below).</li>
1068
1069      <li>Type <tt>"make install"</tt> to install ICU. If you used the --prefix=
1070      option on configure or runConfigureICU, ICU will be installed to the
1071      directory you specified. (See <a href="#HowToInstallICU">installation
1072      note</a> below).</li>
1073    </ol>
1074
1075    <p><a name="HowToWindowsConfigureICU" id=
1076    "HowToWindowsConfigureICU"><strong>Configuring ICU on Windows
1077    NOTE:</strong></a> </p>
1078    <p>
1079    Ensure that the order of the PATH is MSVC, Cygwin, and then other PATHs. The configure
1080    script needs certain tools in Cygwin (e.g. grep).
1081    </p>
1082    <p>
1083    Also, you may need to run <tt>"dos2unix.exe"</tt> on all of the scripts (e.g. configure)
1084    in the top source directory of ICU. To avoid this issue, you can download
1085    the ICU source for Unix platforms (icu-xxx.tgz).
1086    </p>
1087    <p>In addition to the Unix <a href=
1088    "#HowToConfigureICU">configuration note</a> the following configure options
1089    currently do not work on Windows with Microsoft's compiler. Some options can
1090    work by manually editing <tt>icu/source/common/unicode/pwin32.h</tt>, but
1091    manually editing the files is not recommended.</p>
1092
1093    <ul>
1094      <li><tt>--disable-renaming</tt></li>
1095
1096      <li><tt>--enable-tracing</tt></li>
1097
1098      <li><tt>--enable-rpath</tt></li>
1099
1100      <li><tt>--enable-static</tt> (Requires that U_STATIC_IMPLEMENTATION be
1101      defined in user code that links against ICU's static libraries.)</li>
1102
1103      <li><tt>--with-data-packaging=files</tt> (The pkgdata tool currently does
1104      not work in this mode. Manual packaging is required to use this mode.)</li>
1105    </ul>
1106
1107    <h3><a name="HowToBuildUNIX" href="#HowToBuildUNIX" id="HowToBuildUNIX">How
1108    To Build And Install On UNIX</a></h3>
1109
1110    <p>Building International Components for Unicode on UNIX requires:</p>
1111
1112    <ul>
1113      <li>A C++ compiler installed on the target machine (for example: gcc, CC,
1114      xlC_r, aCC, cxx, etc...).</li>
1115
1116      <li>An ANSI C compiler installed on the target machine (for example:
1117      cc).</li>
1118
1119      <li>A recent version of GNU make (3.80+).</li>
1120
1121      <li>For a list of z/OS tools please view the <a href="#HowToBuildZOS">z/OS
1122      build section</a> of this document for further details.</li>
1123    </ul>
1124
1125    <p>Here are the steps to build ICU:</p>
1126
1127    <ol>
1128      <li>Decompress the icu-<i>X</i>.<i>Y</i>.tgz (or
1129      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>
1130
1131      <li>Change directory to <code>icu/source</code>.
1132          <samp>cd icu/source</samp>
1133          </li>
1134
1135      <li>Some files may have the wrong permissions.<samp>chmod +x runConfigureICU configure install-sh</samp></li>
1136
1137      <li>Run the <span style='font-family: monospace;'><a href="source/runConfigureICU">runConfigureICU</a></span>
1138      script for your platform. (See <a href="#HowToConfigureICU">configuration
1139      note</a> below).</li>
1140
1141      <li>Now build: <samp>gmake</samp> (or just <code>make</code> if GNU make is the default make on
1142      your platform) to compile the libraries and all the data files. The proper
1143      name of the GNU make command is printed at the end of the configuration
1144      run, as in <tt>"You must use gmake to compile ICU"</tt>.
1145      <br/>
1146      Note that the compilation command output may be simplified on your platform.  If this is the case, you will see just:
1147      <tt>gcc ... stubdata.c</tt>
1148      rather than
1149      <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>
1150      <br/>
1151      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.
1152      </li>
1153
1154      <li>Optionally,<samp>gmake check</samp> will run the test suite, which
1155      checks for ICU's functionality integrity (See <a href=
1156      "#HowToTestWithoutGmake">testing note</a> below).</li>
1157
1158      <li>To install, <samp>gmake install</samp> to install ICU. If you used the --prefix=
1159      option on configure or runConfigureICU, ICU will be installed to the
1160      directory you specified. (See <a href="#HowToInstallICU">installation
1161      note</a> below).</li>
1162    </ol>
1163
1164    <p><a name="HowToConfigureICU" id="HowToConfigureICU"><strong>Configuring ICU
1165    NOTE:</strong></a> Type <tt>"./runConfigureICU --help"</tt> for help on how
1166    to run it and a list of supported platforms. You may also want to type
1167    <tt>"./configure --help"</tt> to print the available configure options that
1168    you may want to give runConfigureICU. If you are not using the
1169    runConfigureICU script, or your platform is not supported by the script, you
1170    may need to set your CC, CXX, CFLAGS and CXXFLAGS environment variables, and
1171    type <tt>"./configure"</tt>.
1172    HP-UX users, please see this <a href="#ImportantNotesHPUX">note regarding
1173    HP-UX multithreaded build issues</a> with newer compilers. Solaris users,
1174    please see this <a href="#ImportantNotesSolaris">note regarding Solaris
1175    multithreaded build issues</a>.</p>
1176
1177    <p>ICU is built with strict compiler warnings enabled by default.  If this
1178    causes excessive numbers of warnings on your platform, use the --disable-strict
1179    option to configure to reduce the warning level.</p>
1180
1181    <p><a name="HowToTestWithoutGmake" id="HowToTestWithoutGmake"><strong>Running
1182    The Tests From The Command Line NOTE:</strong></a> You may have to set
1183    certain variables if you with to run test programs individually, that is
1184    apart from "gmake check". The environment variable <strong>ICU_DATA</strong>
1185    can be set to the full pathname of the data directory to indicate where the
1186    locale data files and conversion mapping tables are when you are not using
1187    the shared library (e.g. by using the .dat archive or the individual data
1188    files). The trailing "/" is required after the directory name (e.g.
1189    "$Root/source/data/out/" will work, but the value "$Root/source/data/out" is
1190    not acceptable). You do not need to set <strong>ICU_DATA</strong> if the
1191    complete shared data library is in your library path.</p>
1192
1193    <p><a name="HowToInstallICU" id="HowToInstallICU"><strong>Installing ICU
1194    NOTE:</strong></a> Some platforms use package management tools to control the
1195    installation and uninstallation of files on the system, as well as the
1196    integrity of the system configuration. You may want to check if ICU can be
1197    packaged for your package management tools by looking into the "packaging"
1198    directory. (Please note that if you are using a snapshot of ICU from Git, it
1199    is probable that the packaging scripts or related files are not up to date
1200    with the contents of ICU at this time, so use them with caution).</p>
1201
1202    <h3><a name="HowToBuildZOS" href="#HowToBuildZOS" id="HowToBuildZOS">How To
1203    Build And Install On z/OS (OS/390)</a></h3>
1204
1205    <p>You can install ICU on z/OS or OS/390 (the previous name of z/OS), but IBM
1206    tests only the z/OS installation. You install ICU in a z/OS UNIX system
1207    services file system such as HFS or zFS. On this platform, it is important
1208    that you understand a few details:</p>
1209
1210    <ul>
1211      <li>The makedep and GNU make tools are required for building ICU. If it
1212      is not already installed on your system, it is available at the <a href=
1213      "http://www-03.ibm.com/servers/eserver/zseries/zos/unix/bpxa1toy.html">z/OS UNIX -
1214      Tools and Toys</a> site. The PATH environment variable should be updated to
1215      contain the location of this executable prior to build. Failure to add these
1216      tools to your PATH will cause ICU build failures or cause pkgdata to fail
1217      to run.</li>
1218
1219      <li>Since USS does not support using the mmap() function over NFS, it is
1220      recommended that you build ICU on a local filesystem. Once ICU has been
1221      built, you should not have this problem while using ICU when the data
1222      library has been built as a shared library, which is this is the default
1223      setting.</li>
1224
1225      <li>Encoding considerations: The source code assumes that it is compiled
1226      with codepage ibm-1047 (to be exact, the UNIX System Services variant of
1227      it). The pax command converts all of the source code files from ASCII to
1228      codepage ibm-1047 (USS) EBCDIC. However, some files are binary files and
1229      must not be converted, or must be converted back to their original state.
1230      You can use the <a href="as_is/os390/unpax-icu.sh">unpax-icu.sh</a> script
1231      to do this for you automatically. It will unpackage the tar file and
1232      convert all the necessary files for you automatically.</li>
1233
1234      <li>z/OS supports both native S/390 hexadecimal floating point and (with
1235      OS/390 2.6 and later) IEEE 754 binary floating point. This is a compile
1236      time option. Applications built with IEEE should use ICU DLLs that are
1237      built with IEEE (and vice versa). The environment variable IEEE390=0 will
1238      cause the z/OS version of ICU to be built without IEEE floating point
1239      support and use the native hexadecimal floating point. By default ICU is
1240      built with IEEE 754 support. Native floating point support is sufficient
1241      for codepage conversion, resource bundle and UnicodeString operations, but
1242      the Format APIs require IEEE binary floating point.</li>
1243
1244      <li>z/OS introduced the concept of Extra Performance Linkage (XPLINK) to
1245      bring performance improvement opportunities to call-intensive C and C++
1246      applications such as ICU. XPLINK is enabled on a DLL-by-DLL basis, so if
1247      you are considering using XPLINK in your application that uses ICU, you
1248      should consider building the XPLINK-enabled version of ICU. You need to
1249      set ICU's environment variable <code>OS390_XPLINK=1</code> prior to
1250      invoking the make process to produce binaries that are enabled for
1251      XPLINK. The XPLINK option, which is available for z/OS 1.2 and later,
1252      requires the PTF PQ69418 to build XPLINK enabled binaries.</li>
1253
1254      <li>ICU requires XPLINK for the icuio library. If you want to use the
1255      rest of ICU without XPLINK, then you must use the --disable-icuio
1256      configure option.</li>
1257
1258      <li>The latest versions of z/OS use <a
1259      href="https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.cbcux01/oebind6.htm">XPLINK
1260      version (C128) of the C++ standard library</a> by default. You may see <a
1261      href="https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.cbcux01/oebind5.htm">an
1262      error</a> when running with XPLINK disabled. To avoid this error,
1263      set the following environment variable or similar:
1264
1265<pre><samp>export _CXX_PSYSIX="CEE.SCEELIB(C128N)":"CBC.SCLBSID(IOSTREAM,COMPLEX)"</samp></pre>
1266      </li>
1267
1268      <li>When building ICU data, the heap size may need to be increased with the following
1269      environment variable:
1270
1271<pre><samp>export _CEE_RUNOPTS="HEAPPOOLS(ON),HEAP(4M,1M,ANY,FREE,0K,4080)"</samp></pre>
1272      </li>
1273
1274
1275      <li>The rest of the instructions for building and testing ICU on z/OS with
1276      UNIX System Services are the same as the <a href="#HowToBuildUNIX">How To
1277      Build And Install On UNIX</a> section.</li>
1278    </ul>
1279
1280    <h4>z/OS (Batch/PDS) support outside the UNIX system services
1281    environment</h4>
1282
1283    <p>By default, ICU builds its libraries into the UNIX file system (HFS). In
1284    addition, there is a z/OS specific environment variable (OS390BATCH) to build
1285    some libraries into the z/OS native file system. This is useful, for example,
1286    when your application is externalized via Job Control Language (JCL).</p>
1287
1288    <p>The OS390BATCH environment variable enables non-UNIX support including the
1289    batch environment. When OS390BATCH is set, the libicui18n<i>XX</i>.dll,
1290    libicuuc<i>XX</i>.dll, and libicudt<i>XX</i>e.dll binaries are built into
1291    data sets (the native file system). Turning on OS390BATCH does not turn off
1292    the normal z/OS UNIX build. This means that the z/OS UNIX (HFS) DLLs will
1293    always be created.</p>
1294
1295    <p>Two additional environment variables indicate the names of the z/OS data
1296    sets to use. The LOADMOD environment variable identifies the name of the data
1297    set that contains the dynamic link libraries (DLLs) and the LOADEXP
1298    environment variable identifies the name of the data set that contains the
1299    side decks, which are normally the files with the .x suffix in the UNIX file
1300    system.</p>
1301
1302    <p>A data set is roughly equivalent to a UNIX or Windows file. For most kinds
1303    of data sets the operating system maintains record boundaries. UNIX and
1304    Windows files are byte streams. Two kinds of data sets are PDS and PDSE. Each
1305    data set of these two types contains a directory. It is like a UNIX
1306    directory. Each "file" is called a "member". Each member name is limited to
1307    eight bytes, normally EBCDIC.</p>
1308
1309    <p>Here is an example of some environment variables that you can set prior to
1310    building ICU:</p>
1311<pre>
1312<samp>OS390BATCH=1
1313LOADMOD=<i>USER</i>.ICU.LOAD
1314LOADEXP=<i>USER</i>.ICU.EXP</samp>
1315</pre>
1316
1317    <p>The PDS member names for the DLL file names are as follows:</p>
1318<pre>
1319<samp>IXMI<i>XX</i>IN --&gt; libicui18n<i>XX</i>.dll
1320IXMI<i>XX</i>UC --&gt; libicuuc<i>XX</i>.dll
1321IXMI<i>XX</i>DA --&gt; libicudt<i>XX</i>e.dll</samp>
1322</pre>
1323
1324    <p>You should point the LOADMOD environment variable at a partitioned data
1325    set extended (PDSE) and point the LOADEXP environment variable at a
1326    partitioned data set (PDS). The PDSE can be allocated with the following
1327    attributes:</p>
1328<pre>
1329<samp>Data Set Name . . . : <i>USER</i>.ICU.LOAD
1330Management class. . : <i>**None**</i>
1331Storage class . . . : <i>BASE</i>
1332Volume serial . . . : <i>TSO007</i>
1333Device type . . . . : <i>3390</i>
1334Data class. . . . . : <i>LOAD</i>
1335Organization  . . . : PO
1336Record format . . . : U
1337Record length . . . : 0
1338Block size  . . . . : <i>32760</i>
13391st extent cylinders: 1
1340Secondary cylinders : 5
1341Data set name type  : LIBRARY</samp>
1342</pre>
1343
1344    <p>The PDS can be allocated with the following attributes:</p>
1345<pre>
1346<samp>Data Set Name . . . : <i>USER</i>.ICU.EXP
1347Management class. . : <i>**None**</i>
1348Storage class . . . : <i>BASE</i>
1349Volume serial . . . : <i>TSO007</i>
1350Device type . . . . : <i>3390</i>
1351Data class. . . . . : <i>**None**</i>
1352Organization  . . . : PO
1353Record format . . . : FB
1354Record length . . . : 80
1355Block size  . . . . : <i>3200</i>
13561st extent cylinders: 3
1357Secondary cylinders : 3
1358Data set name type  : PDS</samp>
1359</pre>
1360
1361    <h3><a name="HowToBuildOS400" href="#HowToBuildOS400" id=
1362    "HowToBuildOS400">How To Build And Install On The IBM i Family (IBM i, i5/OS OS/400)</a></h3>
1363
1364    <p>Before you start building ICU, ICU requires the following:</p>
1365
1366    <ul>
1367      <li>QSHELL interpreter installed (install base option 30, operating system)
1368      <!--li>QShell Utilities, PRPQ 5799-XEH (not required for V4R5)</li--></li>
1369
1370      <li>ILE C/C++ Compiler installed on the system</li>
1371
1372      <li>The latest IBM tools for Developers for IBM i &mdash;
1373        <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>
1374        <!-- formerly http://www.ibm.com/servers/enable/site/porting/tools/'>http://www.ibm.com/servers/enable/site/porting/tools/</a> -->
1375        <!-- formerly: http://www.ibm.com/servers/enable/site/porting/iseries/overview/gnu_utilities.html -->
1376      </li>
1377    </ul>
1378
1379    <p>The following describes how to setup and build ICU. For background
1380    information, you should look at the <a href="#HowToBuildUNIX">UNIX build
1381    instructions</a>.</p>
1382
1383    <ol>
1384      <li>
1385        Copy the ICU source .tgz to the IBM i environment, as binary.
1386        Also, copy the <a href='as_is/os400/unpax-icu.sh'>unpax-icu.sh</a> script into the same directory, as a text file.
1387      </li>
1388
1389      <li>
1390        Create target library. This library will be the target for the
1391        resulting modules, programs and service programs. You will specify this
1392        library on the OUTPUTDIR environment variable.
1393<pre>
1394<samp>CRTLIB LIB(<i>libraryname</i>)
1395ADDENVVAR ENVVAR(OUTPUTDIR) VALUE('<i>libraryname</i>') REPLACE(*YES)   </samp></pre>
1396      </li>
1397
1398      <li>
1399      Set up the following environment variables and job characteristics in your build process
1400<pre>
1401<samp>ADDENVVAR ENVVAR(MAKE) VALUE('gmake') REPLACE(*YES)
1402CHGJOB CCSID(37)</samp></pre></li>
1403
1404      <li>Fire up the QSH <i>(all subsequent commands are run inside the qsh session.)</i>
1405        <pre><samp>qsh</samp></pre>
1406      </li>
1407
1408      <li>Set up the PATH: <pre><samp>export PATH=/QIBM/ProdData/DeveloperTools/qsh/bin:$PATH:/QOpenSys/usr/bin</samp></pre>
1409      </li>
1410
1411      <li>Unpack the ICU source code archive:
1412        <pre><samp>gzip -d icu-<i>X</i>.<i>Y</i>.tgz</samp></pre>
1413          </li>
1414
1415      <li>Run unpax-icu.sh on the tar file generated from the previous step.
1416        <pre><samp>unpax-icu.sh icu.tar</samp></pre></li>
1417
1418      <li>Build the program ICULD which ICU will use for linkage.
1419        <pre><samp>cd icu/as_is/os400
1420qsh bldiculd.sh
1421cd ../../..</samp></pre>
1422        </li>
1423
1424      <li>Change into the 'source' directory, and configure ICU.  (See <a href="#HowToConfigureICU">configuration
1425      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.
1426        <pre><samp>cd icu/source
1427./runConfigureICU IBMi --prefix=<i>/path/to/somewhere</i> --with-data-packaging=archive</samp></pre>
1428</li>
1429
1430      <li>Build ICU. <i>(Note: Do not use the -j option)</i> <pre><samp>gmake</samp></pre></li>
1431
1432      <li>Test ICU. <pre><samp>gmake check</samp></pre>
1433        (The <tt> QIBM_MULTI_THREADED=Y</tt> flag will be automatically applied to intltest -
1434          you can look at the <a href=
1435      "https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzahw/rzahwceeco.htm">
1436      iSeries Information Center</a> for more details regarding the running of multiple threads
1437      on IBM i.)</li>
1438    </ol>
1439
1440      <!-- cross -->
1441    <h3><a name="HowToCrossCompileICU" href="#HowToCrossCompileICU" id="HowToCrossCompileICU">How To Cross Compile ICU</a></h3>
1442		<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>
1443		<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>
1444		<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>
1445		<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>
1446		<p>Three initially-empty directories will be used in this example:</p>
1447		<table summary="Three directories used in this example" class="docTable">
1448			<tr>
1449				<th align="left">/icu</th><td>a copy of the ICU source</td>
1450			</tr>
1451			<tr>
1452				<th align="left">/buildA</th><td>an empty directory, it will contain ICU built for A<br />(MacOSX in this case)</td>
1453			</tr>
1454			<tr>
1455				<th align="left">/buildB</th><td>an empty directory, it will contain ICU built for B<br />(HaikuOS in this case)</td>
1456			</tr>
1457		</table>
1458
1459		<ol>
1460		<li>Check out or unpack the ICU source code into the /icu directory.You will have the directories /icu/source, etc.</li>
1461		<li>Build ICU in /buildA normally (using runConfigureICU or configure):
1462<pre class="samp">cd /buildA
1463sh /icu/source/runConfigureICU <strong>MacOSX</strong>
1464gnumake
1465</pre>
1466		</li>
1467		<li>Set PATH or other variables as needed, such as CPPFLAGS.</li>
1468		<li>Build ICU in /buildB<br />
1469			<p class="note">"<code>--with-cross-build</code>" takes an absolute path.</p>
1470<pre class="samp">cd /buildB
1471sh /icu/source/configure --host=<strong>i586-pc-haiku</strong> --with-cross-build=<strong>/buildA</strong>
1472gnumake</pre>
1473		</li>
1474		<li>Tests and testdata can be built with "gnumake tests".</li>
1475	</ol>
1476      <!-- end cross -->
1477
1478    <!-- end build environment -->
1479
1480    <h2><a name="HowToPackage" href="#HowToPackage" id="HowToPackage">How To
1481    Package ICU</a></h2>
1482
1483    <p>There are many ways that a person can package ICU with their software
1484    products. Usually only the libraries need to be considered for packaging.</p>
1485
1486    <p>On UNIX, you should use "<tt>gmake install</tt>" to make it easier to
1487    develop and package ICU. The bin, lib and include directories are needed to
1488    develop applications that use ICU. These directories will be created relative
1489    to the "<tt>--prefix=</tt><i>dir</i>" configure option (See the <a href=
1490    "#HowToBuildUNIX">UNIX build instructions</a>). When ICU is built on Windows,
1491    a similar directory structure is built.</p>
1492
1493    <p>When changes have been made to the standard ICU distribution, it is
1494    recommended that at least one of the following guidelines be followed for
1495    special packaging.</p>
1496
1497    <ol>
1498      <li>Add a suffix name to the library names. This can be done with the
1499      --with-library-suffix configure option.</li>
1500
1501      <li>The installation script should install the ICU libraries into the
1502      application's directory.</li>
1503    </ol>
1504
1505    <p>Following these guidelines prevents other applications that use a standard
1506    ICU distribution from conflicting with any libraries that you need. On
1507    operating systems that do not have a standard C++ ABI (name mangling) for
1508    compilers, it is recommended to do this special packaging anyway. More
1509    details on customizing ICU are available in the <a href=
1510    "http://userguide.icu-project.org/">User's Guide</a>. The <a href=
1511    "#SourceCode">ICU Source Code Organization</a> section of this readme.html
1512    gives a more complete description of the libraries.</p>
1513
1514    <table class="docTable" summary=
1515    "ICU has several libraries for you to use.">
1516      <caption>
1517        Here is an example of libraries that are frequently packaged.
1518      </caption>
1519
1520      <tr>
1521        <th scope="col">Library Name</th>
1522
1523        <th scope="col">Windows Filename</th>
1524
1525        <th scope="col">Linux Filename</th>
1526
1527        <th scope="col">Comment</th>
1528      </tr>
1529
1530      <tr>
1531        <td>Data Library</td>
1532
1533        <td>icudt<i>XY</i>l.dll</td>
1534
1535        <td>libicudata.so.<i>XY</i>.<i>Z</i></td>
1536
1537        <td>Data required by the Common and I18n libraries. There are many ways
1538        to package and <a href=
1539        "http://userguide.icu-project.org/icudata">customize this
1540        data</a>, but by default this is all you need.</td>
1541      </tr>
1542
1543      <tr>
1544        <td>Common Library</td>
1545
1546        <td>icuuc<i>XY</i>.dll</td>
1547
1548        <td>libicuuc.so.<i>XY</i>.<i>Z</i></td>
1549
1550        <td>Base library required by all other ICU libraries.</td>
1551      </tr>
1552
1553      <tr>
1554        <td>Internationalization (i18n) Library</td>
1555
1556        <td>icuin<i>XY</i>.dll</td>
1557
1558        <td>libicui18n.so.<i>XY</i>.<i>Z</i></td>
1559
1560        <td>A library that contains many locale based internationalization (i18n)
1561        functions.</td>
1562      </tr>
1563
1564      <tr>
1565        <td>Layout Extensions Engine</td>
1566
1567        <td>iculx<i>XY</i>.dll</td>
1568
1569        <td>libiculx.so.<i>XY</i>.<i>Z</i></td>
1570
1571        <td>An optional engine for doing paragraph layout that uses
1572        parts of ICU.
1573        HarfBuzz is required.</td>
1574      </tr>
1575
1576      <tr>
1577        <td>ICU I/O (Unicode stdio) Library</td>
1578
1579        <td>icuio<i>XY</i>.dll</td>
1580
1581        <td>libicuio.so.<i>XY</i>.<i>Z</i></td>
1582
1583        <td>An optional library that provides a stdio like API with Unicode
1584        support.</td>
1585      </tr>
1586
1587      <tr>
1588        <td>Tool Utility Library</td>
1589
1590        <td>icutu<i>XY</i>.dll</td>
1591
1592        <td>libicutu.so.<i>XY</i>.<i>Z</i></td>
1593
1594        <td>An internal library that contains internal APIs that are only used by
1595        ICU's tools. If you do not use ICU's tools, you do not need this
1596        library.</td>
1597      </tr>
1598    </table>
1599
1600    <p>Normally only the above ICU libraries need to be considered for packaging.
1601    The versionless symbolic links to these libraries are only needed for easier
1602    development. The <i>X</i>, <i>Y</i> and <i>Z</i> parts of the name are the
1603    version numbers of ICU. For example, ICU 2.0.2 would have the name
1604    libicuuc.so.20.2 for the common library. The exact format of the library
1605    names can vary between platforms due to how each platform can handles library
1606    versioning.</p>
1607
1608    <h2><a name="ImportantNotes" href="#ImportantNotes" id=
1609    "ImportantNotes">Important Notes About Using ICU</a></h2>
1610
1611    <h3><a name="ImportantNotesMultithreaded" href="#ImportantNotesMultithreaded"
1612    id="ImportantNotesMultithreaded">Using ICU in a Multithreaded
1613    Environment</a></h3>
1614
1615    <p>Some versions of ICU require calling the <code>u_init()</code> function
1616    from <code>uclean.h</code> to ensure that ICU is initialized properly. In
1617    those ICU versions, <code>u_init()</code> must be called before ICU is used
1618    from multiple threads. There is no harm in calling <code>u_init()</code> in a
1619    single-threaded application, on a single-CPU machine, or in other cases where
1620    <code>u_init()</code> is not required.</p>
1621
1622    <p>In addition to ensuring thread safety, <code>u_init()</code> also attempts
1623    to load at least one ICU data file. Assuming that all data files are packaged
1624    together (or are in the same folder in files mode), a failure code from
1625    <code>u_init()</code> usually means that the data cannot be found. In this
1626    case, the data may not be installed properly, or the application may have
1627    failed to call <code>udata_setCommonData()</code> or
1628    <code>u_setDataDirectory()</code> which specify to ICU where it can find its
1629    data.</p>
1630
1631    <p>Since <code>u_init()</code> will load only one or two data files, it
1632    cannot guarantee that all of the data that an application needs is available.
1633    It cannot check for all data files because the set of files is customizable,
1634    and some ICU services work without loading any data at all. An application
1635    should always check for error codes when opening ICU service objects (using
1636    <code>ucnv_open()</code>, <code>ucol_open()</code>, C++ constructors,
1637    etc.).</p>
1638
1639    <h4>ICU 3.4 and later</h4>
1640
1641    <p>ICU 3.4 self-initializes properly for multi-threaded use. It achieves this
1642    without performance penalty by hardcoding the core Unicode properties data,
1643    at the cost of some flexibility. (For details see Jitterbug 4497.)</p>
1644
1645    <p><code>u_init()</code> can be used to check for data loading. It tries to
1646    load the converter alias table (<code>cnvalias.icu</code>).</p>
1647
1648    <h4>ICU 2.6..3.2</h4>
1649
1650    <p>These ICU versions require a call to <code>u_init()</code> before
1651    multi-threaded use. The services that are directly affected are those that
1652    don't have a service object and need to be fast: normalization and character
1653    properties.</p>
1654
1655    <p><code>u_init()</code> loads and initializes the data files for
1656    normalization and character properties (<code>unorm.icu</code> and
1657    <code>uprops.icu</code>) and can therefore also be used to check for data
1658    loading.</p>
1659
1660    <h4>ICU 2.4 and earlier</h4>
1661
1662    <p>ICU 2.4 and earlier versions were not prepared for multithreaded use on
1663    multi-CPU platforms where the CPUs implement weak memory coherency. These
1664    CPUs include: Power4, Power5, Alpha, Itanium. <code>u_init()</code> was not
1665    defined yet.</p>
1666
1667    <h4><a name="ImportantNotesHPUX" href="#ImportantNotesHPUX" id=
1668    "ImportantNotesHPUX">Using ICU in a Multithreaded Environment on
1669    HP-UX</a></h4>
1670
1671    <p>When ICU is built with aCC on HP-UX, the <a
1672    href="http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=eb08b3f1eee02110b3f1eee02110275d6e10RCRD">-AA</a>
1673    compiler flag is used. It is required in order to use the latest
1674    &lt;iostream&gt; API in a thread safe manner. This compiler flag affects the
1675    version of the C++ library being used. Your applications will also need to
1676    be compiled with -AA in order to use ICU.</p>
1677
1678    <h4><a name="ImportantNotesSolaris" href="#ImportantNotesSolaris" id=
1679    "ImportantNotesSolaris">Using ICU in a Multithreaded Environment on
1680    Solaris</a></h4>
1681
1682    <h5>Linking on Solaris</h5>
1683
1684    <p>In order to avoid synchronization and threading issues, developers are
1685    <strong>suggested</strong> to strictly follow the compiling and linking
1686    guidelines for multithreaded applications, specified in the following
1687    SUn Solaris document available from Oracle. Most notably, pay strict attention to the
1688    following statements from Sun:</p>
1689
1690    <blockquote>
1691      <p>To use libthread, specify -lthread before -lc on the ld command line, or
1692      last on the cc command line.</p>
1693
1694      <p>To use libpthread, specify -lpthread before -lc on the ld command line,
1695      or last on the cc command line.</p>
1696    </blockquote>
1697
1698    <p>Failure to do this may cause spurious lock conflicts, recursive mutex
1699    failure, and deadlock.</p>
1700
1701    <p>Source: "<i>Multithreaded Programming Guide, Compiling and
1702    Debugging</i>", Sun Microsystems, 2002 <br />
1703     <a href=
1704    "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>
1705
1706    <p>Note, a version of that chapter from a 2008 document update covering both Solaris 9
1707    and Solaris 10 is available here:<br />
1708     <a href=
1709    "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>
1710
1711    <h3><a name="ImportantNotesWindows" href="#ImportantNotesWindows" id=
1712    "ImportantNotesWindows">Windows Platform</a></h3>
1713
1714    <p>If you are building on the Windows platform, it is important that you
1715    understand a few of the following build details.</p>
1716
1717    <h4>DLL directories and the PATH setting</h4>
1718
1719    <p>As delivered, the International Components for Unicode build as several
1720    DLLs, which are placed in the "<i>&lt;ICU&gt;</i>\bin64" directory. You must
1721    add this directory to the PATH environment variable in your system, or any
1722    executables you build will not be able to access International Components for
1723    Unicode libraries. Alternatively, you can copy the DLL files into a directory
1724    already in your PATH, but we do not recommend this. You can wind up with
1725    multiple copies of the DLL and wind up using the wrong one.</p>
1726
1727    <h4><a name="ImportantNotesWindowsPath" id=
1728    "ImportantNotesWindowsPath">Changing your PATH</a></h4>
1729
1730    <p><strong>Windows 2000/XP and above</strong>: Use the System Icon in the Control
1731    Panel. Pick the "Advanced" tab. Select the "Environment Variables..."
1732    button. Select the variable PATH in the lower box, and select the lower
1733    "Edit..." button. In the "Variable Value" box, append the string
1734    ";<i>&lt;ICU&gt;</i>\bin64" to the end of the path string. If there is
1735    nothing there, just type in "<i>&lt;ICU&gt;</i>\bin64". Click the Set button,
1736    then the OK button.</p>
1737
1738    <p>Note: When packaging a Windows application for distribution and
1739    installation on user systems, copies of the ICU DLLs should be included with
1740    the application, and installed for exclusive use by the application. This is
1741    the only way to insure that your application is running with the same version
1742    of ICU, built with exactly the same options, that you developed and tested
1743    with. Refer to Microsoft's guidelines on the usage of DLLs, or search for the
1744    phrase "DLL hell" on <a href=
1745    "http://msdn.microsoft.com/">msdn.microsoft.com</a>.</p>
1746
1747    <h3><a name="ImportantNotesUNIX" href="#ImportantNotesUNIX" id=
1748    "ImportantNotesUNIX">UNIX Type Platform</a></h3>
1749
1750    <p>If you are building on a UNIX platform, and if you are installing ICU in a
1751    non-standard location, you may need to add the location of your ICU libraries
1752    to your <strong>LD_LIBRARY_PATH</strong> or <strong>LIBPATH</strong>
1753    environment variable (or the equivalent runtime library path environment
1754    variable for your system). The ICU libraries may not link or load properly
1755    without doing this.</p>
1756
1757    <p>Note that if you do not want to have to set this variable, you may instead
1758    use the --enable-rpath option at configuration time. This option will
1759    instruct the linker to always look for the libraries where they are
1760    installed. You will need to use the appropriate linker options when linking
1761    your own applications and libraries against ICU, too. Please refer to your
1762    system's linker manual for information about runtime paths. The use of rpath
1763    also means that when building a new version of ICU you should not have an
1764    older version installed in the same place as the new version's installation
1765    directory, as the older libraries will used during the build, instead of the
1766    new ones, likely leading to an incorrectly build ICU. This is the proper
1767    behavior of rpath.</p>
1768
1769    <h2><a name="PlatformDependencies" href="#PlatformDependencies" id=
1770    "PlatformDependencies">Platform Dependencies</a></h2>
1771
1772    <h3><a name="PlatformDependenciesNew" href="#PlatformDependenciesNew" id=
1773    "PlatformDependenciesNew">Porting To A New Platform</a></h3>
1774
1775    <p>If you are using ICU's Makefiles to build ICU on a new platform, there are
1776    a few places where you will need to add or modify some files. If you need
1777    more help, you can always ask the <a href=
1778    "http://site.icu-project.org/contacts">icu-support mailing list</a>. Once
1779    you have finished porting ICU to a new platform, it is recommended that you
1780    contribute your changes back to ICU via the icu-support mailing list. This
1781    will make it easier for everyone to benefit from your work.</p>
1782
1783    <h4>Data For a New Platform</h4>
1784
1785    <p>For some people, it may not be necessary for completely build ICU. Most of
1786    the makefiles and build targets are for tools that are used for building
1787    ICU's data, and an application's data (when an application uses ICU resource
1788    bundles for its data).</p>
1789
1790    <p>Data files can be built on a different platform when both platforms share
1791    the same endianness and the same charset family. This assertion does not
1792    include platform dependent DLLs/shared/static libraries. For details see the
1793    User Guide <a href="http://userguide.icu-project.org/icudata">ICU
1794    Data</a> chapter.</p>
1795
1796    <p>ICU 3.6 removes the requirement that ICU be completely built in the native
1797    operating environment. It adds the icupkg tool which can be run on any
1798    platform to turn binary ICU data files from any one of the three formats into
1799    any one of the other data formats. This allows a application to use ICU data
1800    built anywhere to be used for any other target platform.</p>
1801
1802    <p><strong>WARNING!</strong> Building ICU without running the tests is not
1803    recommended. The tests verify that ICU is safe to use. It is recommended that
1804    you try to completely port and test ICU before using the libraries for your
1805    own application.</p>
1806
1807    <h4>Adapting Makefiles For a New Platform</h4>
1808
1809    <p>Try to follow the build steps from the <a href="#HowToBuildUNIX">UNIX</a>
1810    build instructions. If the configure script fails, then you will need to
1811    modify some files. Here are the usual steps for porting to a new
1812    platform:<br />
1813    </p>
1814
1815    <ol>
1816      <li>Create an mh file in icu/source/config/. You can use mh-linux or a
1817      similar mh file as your base configuration.</li>
1818
1819      <li>Modify icu/source/aclocal.m4 to recognize your platform's mh file.</li>
1820
1821      <li>Modify icu/source/configure.in to properly set your <b>platform</b> C
1822      Macro define.</li>
1823
1824      <li>Run <a href="http://www.gnu.org/software/autoconf/">autoconf</a> in
1825      icu/source/ without any options. The autoconf tool is standard on most
1826      Linux systems.</li>
1827
1828      <li>If you have any optimization options that you want to normally use, you
1829      can modify icu/source/runConfigureICU to specify those options for your
1830      platform.</li>
1831
1832      <li>Build and test ICU on your platform. It is very important that you run
1833      the tests. If you don't run the tests, there is no guarentee that you have
1834      properly ported ICU.</li>
1835    </ol>
1836
1837    <h3><a name="PlatformDependenciesImpl" href="#PlatformDependenciesImpl" id=
1838    "PlatformDependenciesImpl">Platform Dependent Implementations</a></h3>
1839
1840    <p>The platform dependencies have been mostly isolated into the following
1841    files in the common library. This information can be useful if you are
1842    porting ICU to a new platform.</p>
1843
1844    <ul>
1845      <li>
1846        <strong>unicode/platform.h.in</strong> (autoconf'ed platforms)<br />
1847         <strong>unicode/p<i>XXXX</i>.h</strong> (others: pwin32.h, ppalmos.h,
1848        ..): Platform-dependent typedefs and defines:<br />
1849        <br />
1850
1851
1852        <ul>
1853          <li>Generic types like UBool, int8_t, int16_t, int32_t, int64_t,
1854          uint64_t etc.</li>
1855
1856          <li>U_EXPORT and U_IMPORT for specifying dynamic library import and
1857          export</li>
1858
1859          <li>String handling support for the char16_t and wchar_t types.</li>
1860        </ul>
1861        <br />
1862      </li>
1863
1864      <li>
1865        <strong>unicode/putil.h, putil.c</strong>: platform-dependent
1866        implementations of various functions that are platform dependent:<br />
1867        <br />
1868
1869
1870        <ul>
1871          <li>uprv_isNaN, uprv_isInfinite, uprv_getNaN and uprv_getInfinity for
1872          handling special floating point values.</li>
1873
1874          <li>uprv_tzset, uprv_timezone, uprv_tzname and time for getting
1875          platform specific time and time zone information.</li>
1876
1877          <li>u_getDataDirectory for getting the default data directory.</li>
1878
1879          <li>uprv_getDefaultLocaleID for getting the default locale
1880          setting.</li>
1881
1882          <li>uprv_getDefaultCodepage for getting the default codepage
1883          encoding.</li>
1884        </ul>
1885        <br />
1886      </li>
1887
1888      <li>
1889        <strong>umutex.h, umutex.c</strong>: Code for doing synchronization in
1890        multithreaded applications. If you wish to use International Components
1891        for Unicode in a multithreaded application, you must provide a
1892        synchronization primitive that the classes can use to protect their
1893        global data against simultaneous modifications. We already supply working
1894        implementations for many platforms that ICU builds on.<br />
1895        <br />
1896      </li>
1897
1898      <li><strong>umapfile.h, umapfile.c</strong>: functions for mapping or
1899      otherwise reading or loading files into memory. All access by ICU to data
1900      from files makes use of these functions.<br />
1901      <br />
1902      </li>
1903
1904      <li>Using platform specific #ifdef macros are highly discouraged outside of
1905      the scope of these files. When the source code gets updated in the future,
1906      these #ifdef's can cause testing problems for your platform.</li>
1907    </ul>
1908    <hr />
1909    <p> Copyright &copy; 2016 and later: Unicode, Inc. and others. License &amp; terms of use:
1910    <a href="http://www.unicode.org/copyright.html">http://www.unicode.org/copyright.html</a><br/>
1911    Copyright &copy; 1997-2016 International Business Machines Corporation and  others.
1912    All Rights Reserved.</p>
1913  </body>
1914</html>
1915