Character classification
A GLS locale groups the characters of a code set into character classes. Each class contains characters that have a related purpose.
The contents of a character class can be language specific. For example, the lower class contains all alphabetic lowercase characters in a code set. In the default locale, the default code set groups the English characters a through z into the lower class, but it also includes lowercase characters such as á, ⪚, , õ, and ü.
The default code set on UNIX platforms is ISO8859-1. The default code set for Windows environments is Microsoft 1252.
For more information about the default locale and the default code set, see the HCL Informix GLS User's Guide.
Character class | Contains |
---|---|
alpha | Alphabetic characters:
|
lower | Lowercase alphabetic characters:
|
upper | Uppercase alphabetic characters:
|
digit | Single-byte decimal digits 0 through 9 |
xdigit | Hexadecimal digits:
|
alnum | All characters in both the alpha and digit classes. |
blank | Horizontal white space:
|
space | Horizontal and vertical white space:
|
cntrl | Control characters:
|
graph | Graphical characters are all characters that have visual representation. This class includes characters in the alpha, lower, upper, digit, xdigit, and punct classes. |
punct | Punctuation:
|
All printable characters This class includes characters in the alpha, lower, upper, digit, xdigit, graph, and punct classes. |
if ( one_char >= 'a' && one_char <= 'z' )
Character class | Multibyte-character function | Wide-character function |
---|---|---|
alnum (alpha or digit) | ifx_gl_ismalnum() | ifx_gl_iswalnum() |
alpha | ifx_gl_ismalpha() | ifx_gl_iswalpha() |
lower | ifx_gl_ismlower() | ifx_gl_iswlower() |
upper | ifx_gl_ismupper() | ifx_gl_iswupper() |
blank | ifx_gl_ismblank() | ifx_gl_iswblank() |
space | ifx_gl_ismspace() | ifx_gl_iswspace() |
digit | ifx_gl_ismdigit() | ifx_gl_iswdigit() |
xdigit | ifx_gl_ismxdigit() | ifx_gl_iswxdigit() |
cntrl | ifx_gl_ismcntrl() | ifx_gl_iswcntrl() |
graph | ifx_gl_ismgraph() | ifx_gl_iswgraph() |
punct | ifx_gl_ismpunct() | ifx_gl_iswpunct() |
ifx_gl_ismprint() | ifx_gl_iswprint() |
if ( ifx_gl_ismlower(one_char, char_size)
/* Initialize the error number */
ifx_gl_lc_errno() = 0;
/* Determine if 'mb' character is lowercase */
value = ifx_gl_ismlower(mb, mb_size);
/* If the error number has changed, ifx_gl_ismlower()has
* set it to indicate the cause of an error */
if ( ifx_gl_lc_errno() != 0 )
/* Handle error */
else if ( value != 0 )
/* Character 'mb' is in lower class */
else if ( value == 0 )
/* Character 'mb' is NOT in lower class */