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