12e5b6d6dSopenharmony_ciCopyright (C) 2016 and later: Unicode, Inc. and others. 22e5b6d6dSopenharmony_ciLicense & terms of use: http://www.unicode.org/copyright.html 32e5b6d6dSopenharmony_ci 42e5b6d6dSopenharmony_ciCopyright (c) 2002-2005, International Business Machines Corporation and others. All Rights Reserved. 52e5b6d6dSopenharmony_cicoll: a sample program which compares 2 strings with a user-defined collator. 62e5b6d6dSopenharmony_ci 72e5b6d6dSopenharmony_ciThis sample demonstrates 82e5b6d6dSopenharmony_ci Creating a user-defined collator 92e5b6d6dSopenharmony_ci Comparing 2 string using the collator created 102e5b6d6dSopenharmony_ci 112e5b6d6dSopenharmony_ciFiles: 122e5b6d6dSopenharmony_ci coll.c Main source file 132e5b6d6dSopenharmony_ci coll.sln Windows MSVC workspace. Double-click this to get started. 142e5b6d6dSopenharmony_ci coll.vcproj Windows MSVC project file 152e5b6d6dSopenharmony_ci 162e5b6d6dSopenharmony_ciTo Build coll on Windows 172e5b6d6dSopenharmony_ci 1. Install and build ICU 182e5b6d6dSopenharmony_ci 2. In MSVC, open the workspace file icu\samples\coll\coll.sln 192e5b6d6dSopenharmony_ci 3. Choose a Debug or Release build. 202e5b6d6dSopenharmony_ci 4. Build. 212e5b6d6dSopenharmony_ci 222e5b6d6dSopenharmony_ciTo Run on Windows 232e5b6d6dSopenharmony_ci 1. Start a command shell window 242e5b6d6dSopenharmony_ci 2. Add ICU's bin directory to the path, e.g. 252e5b6d6dSopenharmony_ci set PATH=c:\icu\bin;%PATH% 262e5b6d6dSopenharmony_ci (Use the path to where ever ICU is on your system.) 272e5b6d6dSopenharmony_ci 3. cd into the coll directory, e.g. 282e5b6d6dSopenharmony_ci cd c:\icu\source\samples\coll\debug 292e5b6d6dSopenharmony_ci 4. Run it 302e5b6d6dSopenharmony_ci coll [options*] -source source_string -target target_string 312e5b6d6dSopenharmony_ci 322e5b6d6dSopenharmony_ciTo Build on Unixes 332e5b6d6dSopenharmony_ci 1. Build ICU. coll is built automatically by default unless samples are turned off. 342e5b6d6dSopenharmony_ci Specify an ICU install directory when running configure, 352e5b6d6dSopenharmony_ci using the --prefix option. The steps to build ICU will look something 362e5b6d6dSopenharmony_ci like this: 372e5b6d6dSopenharmony_ci cd <icu directory>/source 382e5b6d6dSopenharmony_ci runConfigureICU <platform-name> --prefix <icu install directory> [other options] 392e5b6d6dSopenharmony_ci gmake all 402e5b6d6dSopenharmony_ci 412e5b6d6dSopenharmony_ci 2. Install ICU, 422e5b6d6dSopenharmony_ci gmake install 432e5b6d6dSopenharmony_ci 442e5b6d6dSopenharmony_ci To Run on Unixes 452e5b6d6dSopenharmony_ci cd <icu directory>/source/samples/coll 462e5b6d6dSopenharmony_ci 472e5b6d6dSopenharmony_ci gmake check 482e5b6d6dSopenharmony_ci -or- 492e5b6d6dSopenharmony_ci 502e5b6d6dSopenharmony_ci export LD_LIBRARY_PATH=<icu install directory>/lib:.:$LD_LIBRARY_PATH 512e5b6d6dSopenharmony_ci cal 522e5b6d6dSopenharmony_ci 532e5b6d6dSopenharmony_ci 542e5b6d6dSopenharmony_ci Note: The name of the LD_LIBRARY_PATH variable is different on some systems. 552e5b6d6dSopenharmony_ci If in doubt, run the sample using "gmake check", and note the name of 562e5b6d6dSopenharmony_ci the variable that is used there. LD_LIBRARY_PATH is the correct name 572e5b6d6dSopenharmony_ci for Linux and Solaris. 582e5b6d6dSopenharmony_ci 59