From owner-freebsd-questions@FreeBSD.ORG Mon Dec 1 21:29:09 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F31C616A4CE for ; Mon, 1 Dec 2003 21:29:08 -0800 (PST) Received: from falcon.midgard.homeip.net (h201n1fls24o1048.bredband.comhem.se [212.181.162.201]) by mx1.FreeBSD.org (Postfix) with SMTP id 778E543FDF for ; Mon, 1 Dec 2003 21:29:00 -0800 (PST) (envelope-from ertr1013@student.uu.se) Received: (qmail 38688 invoked by uid 1001); 2 Dec 2003 05:28:58 -0000 Date: Tue, 2 Dec 2003 06:28:58 +0100 From: Erik Trulsson To: questions@FreeBSD.org Message-ID: <20031202052858.GA11469@falcon.midgard.homeip.net> Mail-Followup-To: questions@FreeBSD.org References: <20031202003105.GA11013@watt.intra.caraldi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20031202003105.GA11013@watt.intra.caraldi.com> User-Agent: Mutt/1.5.5.1i Subject: Re: Is non-breaking space a space? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2003 05:29:09 -0000 On Tue, Dec 02, 2003 at 01:31:07AM +0100, Jean-Baptiste Quenot wrote: > Hello, >=20 > 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 =AB=A0single C chars locales=A0=BB like en_US.ISO8859-1. FreeBSD and glibc people have obviously made different decisions about how the locales should be defined. For what it is worth, both Solaris and NetBSD agree with FreeBSD on this. >=20 > 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? According to the C standard it is implementation-defined (for locales other than the "C" locale. In the "C" locale NBSP is not considered as a space.) Both the Linux and FreeBSD definitions are compatible with the C standard. If you look at the locale definitions found at http://www.dkuug.dk/JTC1/SC22/WG15 it would seem that NBSP should be considered as a space character, but there might be some other standard somewhere else that says differently. My belief is that FreeBSD gets it right, and GNU libc is wrong, but I am sure the GNU people have a different opinion. --=20 Erik Trulsson ertr1013@student.uu.se