HP 9000 User Manual page 135

Computers
Hide thumbs Also See for 9000:
Table of Contents

Advertisement

8
The Character Conversion Command-iconv(1)
The syntax for evoking the iconv command is:
iconv -f
fromcode
-t
tocode [file ... }
where:
fromcode
tocode
[file ... ]
Identifies the source codeset.
Identifies the target codeset.
Identifies input and output files, if any. If no arguments are
specified standard input and standard output are used.
For more information or HP defined values for fromcode and tocode see
iconv(l) in the HP-UX Reference.
Conversion Routines-iconv(3C)
When you convert codesets within an application you can avoid the overhead
involved in a command line call to a systems routine by using library routines
instead. These routines give you more control over the conversion process (for
example, you can specify your own default values for unmappable characters).
When you convert codesets using these routines, the first step is to determine if
a conversion table is needed. If a table is required, you must determine its size
so you can allocate enough memory. Use iconvsize to perform this function.
The syntax of the routine is:
#include <iconv.h>
int iconvsize (tocode, fromcode)
char *tocode;
char *fromcode;
This routine evaluates the requirements for converting the codeset specified by
fromcode to the codeset specified by tocode:
• If a conversion table is needed and exists, the size of the table in bytes is
returned.
• If a table is needed, but the table is nonexistent, then
-1
is returned.
• If a conversion table is not needed,
0
is returned.
8-2 Advanced NLS Topics

Advertisement

Table of Contents
loading

Table of Contents