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) 2001-2010 International Business Machines 52e5b6d6dSopenharmony_ciCorporation and others. All Rights Reserved. 62e5b6d6dSopenharmony_ciuresb: Resource Bundle 72e5b6d6dSopenharmony_ci 82e5b6d6dSopenharmony_ciThis sample demonstrates 92e5b6d6dSopenharmony_ci Building a resource bundle 102e5b6d6dSopenharmony_ci Using ICU to print data from a resource bundle 112e5b6d6dSopenharmony_ci 122e5b6d6dSopenharmony_ci 132e5b6d6dSopenharmony_ciFiles: 142e5b6d6dSopenharmony_ci uresb.c Main source file in C 152e5b6d6dSopenharmony_ci uresb.sln Windows MSVC workspace. Double-click this to get started. 162e5b6d6dSopenharmony_ci uresb.vcproj Windows MSVC project file 172e5b6d6dSopenharmony_ci resources.dsp Windows project file for resources 182e5b6d6dSopenharmony_ci resources.mak Windows makefile for resources 192e5b6d6dSopenharmony_ci 202e5b6d6dSopenharmony_ci root.txt Root resource bundle 212e5b6d6dSopenharmony_ci en.txt English translation 222e5b6d6dSopenharmony_ci sr.txt Serbian translation (cp1251) 232e5b6d6dSopenharmony_ci 242e5b6d6dSopenharmony_ciTo Build uresb on Windows 252e5b6d6dSopenharmony_ci 1. Install and build ICU 262e5b6d6dSopenharmony_ci 2. In MSVC, open the workspace file icu\samples\uresb\uresb.sln 272e5b6d6dSopenharmony_ci 3. Choose a Debug or Release build. 282e5b6d6dSopenharmony_ci 4. Build. 292e5b6d6dSopenharmony_ci 302e5b6d6dSopenharmony_ciTo Run on Windows 312e5b6d6dSopenharmony_ci 1. Start a command shell window 322e5b6d6dSopenharmony_ci 2. Add ICU's bin directory to the path, e.g. 332e5b6d6dSopenharmony_ci set PATH=c:\icu\bin;%PATH% 342e5b6d6dSopenharmony_ci (Use the path to where ever ICU is on your system.) 352e5b6d6dSopenharmony_ci 3. cd into the uresb directory, e.g. 362e5b6d6dSopenharmony_ci cd c:\icu\source\samples\uresb\debug 372e5b6d6dSopenharmony_ci 4. Run it (with a locale name, ex. english) 382e5b6d6dSopenharmony_ci uresb en 392e5b6d6dSopenharmony_ci WARNING: The .txt files must be in the same directory as the executable, which is not the case by default on some systems. 402e5b6d6dSopenharmony_ci 412e5b6d6dSopenharmony_ciTo Build on Unixes 422e5b6d6dSopenharmony_ci 1. Build ICU. 432e5b6d6dSopenharmony_ci Specify an ICU install directory when running configure, 442e5b6d6dSopenharmony_ci using the --prefix option. The steps to build ICU will look something 452e5b6d6dSopenharmony_ci like this: 462e5b6d6dSopenharmony_ci cd <icu directory>/source 472e5b6d6dSopenharmony_ci runConfigureICU <platform-name> --prefix <icu install directory> [other options] 482e5b6d6dSopenharmony_ci gmake all 492e5b6d6dSopenharmony_ci 502e5b6d6dSopenharmony_ci 2. Install ICU, 512e5b6d6dSopenharmony_ci gmake install 522e5b6d6dSopenharmony_ci 532e5b6d6dSopenharmony_ci 3. Compile 542e5b6d6dSopenharmony_ci cd <icu directory>/source/samples/uresb 552e5b6d6dSopenharmony_ci gmake ICU_PREFIX=<icu install directory) ICU_PATH=<icu source directory> 562e5b6d6dSopenharmony_ci 572e5b6d6dSopenharmony_ci To Run on Unixes 582e5b6d6dSopenharmony_ci cd <icu directory>/source/samples/uresb 592e5b6d6dSopenharmony_ci 602e5b6d6dSopenharmony_ci gmake ICU_PREFIX=<icu install directory> check 612e5b6d6dSopenharmony_ci -or- 622e5b6d6dSopenharmony_ci 632e5b6d6dSopenharmony_ci export LD_LIBRARY_PATH=<icu install directory>/lib:.:$LD_LIBRARY_PATH 642e5b6d6dSopenharmony_ci uresb 652e5b6d6dSopenharmony_ci 662e5b6d6dSopenharmony_ci 672e5b6d6dSopenharmony_ci Note: The name of the LD_LIBRARY_PATH variable is different on some systems. 682e5b6d6dSopenharmony_ci If in doubt, run the sample using "gmake check", and note the name of 692e5b6d6dSopenharmony_ci the variable that is used there. LD_LIBRARY_PATH is the correct name 702e5b6d6dSopenharmony_ci for Linux and Solaris. 712e5b6d6dSopenharmony_ci 72