The ifx_gl_conv_needed() function
The ifx_gl_conv_needed() function determines whether code-set conversion between two code sets is required.
Syntax
#include <ifxgls.h>
...
int ifx_gl_conv_needed(dst_codeset, src_codeset)
char *dst_codeset;
char *src_codeset;
- dst_codeset
- A pointer to the name of the destination (target) code set.
- src_codeset
- A pointer to the name of the source code set.
Valid in client application | Valid in DataBlade® UDR |
---|---|
Yes | Yes |
Usage
The ifx_gl_conv_needed() function determines whether characters encoded in src_codeset require conversion to dst_codeset. It is not enough to compare the names of the code sets because several names can identify the same code set. For example, 8859-1, 819, and Latin-1 refer to the same code set.
The code sets, src_codeset and dst_codeset,
can be any of the following:
- Locale names
- Code-set names
- The IFX_GL_PROC_CS macro
Return values
- 0
- Code-set conversion is not needed between the code sets that dst_codeset and src_codeset specify.
- 1
- Code-set conversion is needed between the code sets that dst_codeset and src_codeset specify.
- -1
- The function was not successful, and the error number is set to indicate the cause. See the Errors section.
Errors
If an error occurred, the function
sets the ifx_gl_lc_errno() error number to one
of the following values.
- IFX_GL_EINVAL
- The src_codeset string is not a valid locale specification or code-set name, or the code-set name could not be mapped to a code-set number.
- IFX_GL_EBADF
- Function cannot find the code-set registry.
- IFX_GL_BADFILEFORM
- Bad format found in the code-set registry.