[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get isblank?
From: |
Bruno Haible |
Subject: |
Re: How to get isblank? |
Date: |
Sun, 18 Oct 2009 21:51:11 +0200 |
User-agent: |
KMail/1.9.9 |
Reuben Thomas wrote:
> 2009/10/7 Eric Blake <address@hidden>:
> > Can we add a summary of this logic to the isblank.texi documentation, to
> > point people to better replacements?
>
> Proposed patch:
>
> diff --git a/doc/posix-functions/isblank.texi
> b/doc/posix-functions/isblank.texi
> index 2547793..a4924c7 100644
> --- a/doc/posix-functions/isblank.texi
> +++ b/doc/posix-functions/isblank.texi
> @@ -16,3 +16,14 @@ Portability problems not fixed by Gnulib:
> This function is missing on some platforms:
> AIX 4.3.2, IRIX 6.5, OSF/1 5.1, Solaris 9, mingw.
> @end itemize
> +
> +There is no module for isblank because, first, it has not often been
> +requested, and secondly, on all known platforms, in all predefined
> +locales, @code{isblank(c)} is probably equivalent to @code{(c == ' ' ||
> +c == '\t')}. Look at the glibc definition (in
> address@hidden/localedata/locales/i18n}): the "blank" characters are `\t',
> +` ', U+1680, U+180E, U+2000 to U+2006, U+2008 to U+200A, U+205F, U+3000,
> +and only the first two are present in a common 8-bit encoding. Hence,
> +instead of using this function, with platform dependent semantics, most
> +programs will either want the pure ASCII version (@code{c_isblank}) or
> +the Unicode aware version (@code{uc_is_blank}).
The doc is right. But instead of documenting the absence of a module, we
can as well implement it, with not much trouble.
I'll commit three patches:
- new module ctype,
- new module isblank,
- documentation about the four alternative APIs.
Bruno