Previous: , Up: Case mappings <unicase.h>   [Contents][Index]


14.5 Case detection

The following functions determine whether a Unicode string is entirely in upper case. or entirely in lower case, or entirely in title case, or already case-folded.

Function: int u8_is_uppercase (const uint8_t *s, size_t n, const char *iso639_language, bool *resultp)
Function: int u16_is_uppercase (const uint16_t *s, size_t n, const char *iso639_language, bool *resultp)
Function: int u32_is_uppercase (const uint32_t *s, size_t n, const char *iso639_language, bool *resultp)

Sets *resultp to true if mapping NFD(s) to upper case is a no-op, or to false otherwise, and returns 0. Upon failure, returns -1 with errno set.

Function: int u8_is_lowercase (const uint8_t *s, size_t n, const char *iso639_language, bool *resultp)
Function: int u16_is_lowercase (const uint16_t *s, size_t n, const char *iso639_language, bool *resultp)
Function: int u32_is_lowercase (const uint32_t *s, size_t n, const char *iso639_language, bool *resultp)

Sets *resultp to true if mapping NFD(s) to lower case is a no-op, or to false otherwise, and returns 0. Upon failure, returns -1 with errno set.

Function: int u8_is_titlecase (const uint8_t *s, size_t n, const char *iso639_language, bool *resultp)
Function: int u16_is_titlecase (const uint16_t *s, size_t n, const char *iso639_language, bool *resultp)
Function: int u32_is_titlecase (const uint32_t *s, size_t n, const char *iso639_language, bool *resultp)

Sets *resultp to true if mapping NFD(s) to title case is a no-op, or to false otherwise, and returns 0. Upon failure, returns -1 with errno set.

Function: int u8_is_casefolded (const uint8_t *s, size_t n, const char *iso639_language, bool *resultp)
Function: int u16_is_casefolded (const uint16_t *s, size_t n, const char *iso639_language, bool *resultp)
Function: int u32_is_casefolded (const uint32_t *s, size_t n, const char *iso639_language, bool *resultp)

Sets *resultp to true if applying case folding to NFD(S) is a no-op, or to false otherwise, and returns 0. Upon failure, returns -1 with errno set.

The following functions determine whether case mappings have any effect on a Unicode string.

Function: int u8_is_cased (const uint8_t *s, size_t n, const char *iso639_language, bool *resultp)
Function: int u16_is_cased (const uint16_t *s, size_t n, const char *iso639_language, bool *resultp)
Function: int u32_is_cased (const uint32_t *s, size_t n, const char *iso639_language, bool *resultp)

Sets *resultp to true if case matters for s, that is, if mapping NFD(s) to either upper case or lower case or title case is not a no-op. Set *resultp to false if NFD(s) maps to itself under the upper case mapping, under the lower case mapping, and under the title case mapping; in other words, when NFD(s) consists entirely of caseless characters. Upon failure, returns -1 with errno set.


Previous: Case insensitive comparison, Up: Case mappings <unicase.h>   [Contents][Index]