Is non-breaking space a space?
Jean-Baptiste Quenot
jb.quenot at caraldi.com
Mon Dec 1 16:31:12 PST 2003
Hello,
I'm wondering why the non-breaking space is considered as a space in the
FreeBSD C library, whereas it is not in the GNU libc. Sorry for
comparing the two, but as a result, Linux and FreeBSD are incompatible
in the way they handle isspace(160). This *only* occurs when LC_CTYPE
is given « single C chars locales » like en_US.ISO8859-1.
In /usr/src/share/mklocale, the file la_LN.ISO8859-1.src for example
contains a SPACE definition that includes the non-breaking space. It
seems that it is so since the beginning of FreeBSD, but is there some
reference, some standard that states whether NBSP is considered a space
or not?
BTW the « official » [1]sources for glibc ctype functions have an
interesting comment:
static bool
is_space (unsigned int ch)
{
/* Don't make U+00A0 a space. Non-breaking space means that all programs
should treat it like a punctuation character, not like a space. */
Best regards,
--
Jean-Baptiste Quenot
http://caraldi.com/jbq/
[1] http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/localedata/gen-unicode-ctype.c?rev=1.4&content-type=text/x-cvsweb-markup&cvsroot=glibc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20031202/1562f677/attachment.bin
More information about the freebsd-questions
mailing list