]>
Commit | Line | Data |
---|---|---|
1 | Copyright (C) 2002-2010, International Business Machines | |
2 | Corporation and others. All Rights Reserved. | |
3 | ||
4 | convsamp: a sample program which demonstrates using ICU conversion | |
5 | ||
6 | This sample demonstrates | |
7 | Opening and closing converters using the C api | |
8 | String manipulation in C | |
9 | Writing a custom conversion callback function | |
10 | ||
11 | ||
12 | Files: | |
13 | convsamp.c Main source file | |
14 | flagcb.h codepage output convenience header | |
15 | flagcb.c codepage output convenience implementation | |
16 | ucnv.sln Windows MSVC workspace. Double-click this to get started. | |
17 | ucnv.vcproj Windows MSVC project file | |
18 | ||
19 | To Build ucnv on Windows | |
20 | 1. Install and build ICU | |
21 | 2. In MSVC, open the workspace file icu\samples\ucnv\ucnv.sln | |
22 | 3. Choose a Debug or Release build. | |
23 | 4. Build. | |
24 | ||
25 | To Run on Windows | |
26 | 1. Start a command shell window | |
27 | 2. Add ICU's bin directory to the path, e.g. | |
28 | set PATH=c:\icu\bin;%PATH% | |
29 | (Use the path to where ever ICU is on your system.) | |
30 | 3. cd into the ufortune directory, e.g. | |
31 | cd c:\icu\source\samples\ucnv\debug | |
32 | 4. Run it | |
33 | ucnv | |
34 | WARNING: The .bin and .txt files must be in the same directory as the executable, which is not the case by default on some systems. | |
35 | ||
36 | To Build on Unixes | |
37 | 1. Build ICU. | |
38 | Specify an ICU install directory when running configure, | |
39 | using the --prefix option. The steps to build ICU will look something | |
40 | like this: | |
41 | cd <icu directory>/source | |
42 | runConfigureICU <platform-name> --prefix <icu install directory> [other options] | |
43 | gmake all | |
44 | ||
45 | 2. Install ICU, | |
46 | gmake install | |
47 | ||
48 | 3. Build | |
49 | set the variable ICU_PREFIX=<icu install> | |
50 | gmake all | |
51 | ||
52 | To Run on Unixes | |
53 | cd <icu directory>/source/samples/ucnv | |
54 | ||
55 | gmake check | |
56 | -or- | |
57 | ||
58 | export LD_LIBRARY_PATH=<icu install directory>/lib:.:$LD_LIBRARY_PATH | |
59 | convsamp | |
60 | ||
61 | ||
62 | Note: The name of the LD_LIBRARY_PATH variable is different on some systems. | |
63 | If in doubt, run the sample using "gmake check", and note the name of | |
64 | the variable that is used there. LD_LIBRARY_PATH is the correct name | |
65 | for Linux and Solaris. | |
66 |