Standards / Extensions | C or C++ | Dependencies |
---|---|---|
Language Environment | both |
#include <stdlib.h>
int csid(const char *c)
External entry point: @@CSID, __csid;
Determines the character set identifier for the specified multibyte character pointed to by c, that begins in the initial shift state.
To avoid infringing on the user's name space, this nonstandard function has two names. One name is prefixed with two underscore characters, and one name is not. The name without the prefix underscore characters is exposed only when you use LANGLVL(EXTENDED).
To use this function, you must either invoke the function using its external entry point name (that is, the name that begins with two underscore characters), or compile with LANGLVL(EXTENDED). When you use LANGLVL(EXTENDED) any relevant information in the header is also exposed.
If successful, csid() returns the character-set identifier for the multibyte character.
If the character is not valid, csid() returns -1.
⁄* CELEBC29
This example checks character set ID for a character.
*⁄
#include "locale.h"
#include "stdio.h"
#include "stdlib.h"
main() {
char *string = "A";
int rc;
rc = csid(string);
printf("character '%s' is in character set id %i\n", string, rc);
}
character 'A' is in character set id 0