ATMI C Function Reference
tpconvmb()
—Converts encoding of characters in an input buffer to a named target encoding.
#include <atmi.h>
extern int tperrno;
int
tpconvmb (char **bufp, int *len, char *target_encoding, long flags)
This function is used to convert an input buffer to a desired codeset encoding.
This function is added for user convenience and is not required for normal codeset data conversion that is done automatically.
The bufp
argument is a valid pointer to an MBSTRING typed buffer message. This pointer will be reallocated internally if the size of the buffer is insufficient to handle the output data of the converted buffer.
The len
argument, on input, contains the number of bytes that need to be converted. Upon successful completion of conversion it will contain the number of bytes used in bufp.
The target_encoding
argument is the target codeset encoding name used to convert the typed buffer provided in the bufp message.
The flags
argument is not used by the Tuxedo conversion code. It will be passed along to the buffer type switch function for user defined conversion functions.
Upon success, tpconvmb() returns 0. This function returns -1 on error and sets tperrno as described below. The function may fail for the following reasons.