Next: ispunct_l
, Previous: isprint_l
, Up: ISO C and POSIX Function Substitutes [Contents][Index]
ispunct
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ispunct.html
Gnulib module: ctype
Portability problems fixed by Gnulib:
Portability problems not fixed by Gnulib:
Note: This function’s behaviour depends on the locale, but does not support
the multibyte characters that occur in strings in locales with
MB_CUR_MAX > 1
(this includes all the common UTF-8 locales).
There are five alternative APIs:
c_ispunct
This function operates in a locale independent way and returns true only for ASCII characters. It is provided by the Gnulib module ‘c-ctype’.
iswpunct
This function operates in a locale dependent way, on wide characters. In
order to use it, you first have to convert from multibyte to wide characters,
using the mbrtowc
function. It is provided by the Gnulib module
‘wctype’.
c32ispunct
This function operates in a locale dependent way, on 32-bit wide characters.
In order to use it, you first have to convert from multibyte to 32-bit wide
characters, using the mbrtoc32
function. It is provided by the
Gnulib module ‘c32ispunct’.
mb_ispunct
This function operates in a locale dependent way, on multibyte characters. It is provided by the Gnulib module ‘mbchar’.
uc_is_punct
This function operates in a locale independent way, on Unicode characters. It is provided by the Gnulib module ‘unictype/ctype-punct’.