On 25/03/2024 22:28, Bruno Haible wrote:
Pádraig Brady wrote:
while uniq (c32isblank) now determines
it is not blank (which seems more correct).

I agree that U+00A0 NO-BREAK SPACE should better be considered to be non-blank
(and Gnulib's c32isblank does so).

The only solaris 11 system I have access to, only has the fr_FR.UTF-8 locale 
installed,
not the unibyte version

You should also have access to cfarm215.cfarm.net and cfarm216.cfarm.net
(just announced today).

Nice machines.
Though I can't repo there, I'm guessing because they've
both multi and uni byte fr locales installed.
I'll apply the attached anyway which should avoid this issue.

cheers,
Pádraig
From 6b3f75701de074da27ec7995c2d9174914f44ef4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com>
Date: Tue, 26 Mar 2024 15:02:17 +0000
Subject: [PATCH] tests: avoid false failure due to mismatched isblank()

There is a mismatch between isblank() used by tr and c32isblank() now
used by uniq. On Solaris 11 OpenIndiana isblank() was seen to return
true for non breaking space, while c32isblank() returned false. This may
have been because only the single byte fr locale was installed.
Interestingly on Solaris non breaking space is considered a blank
character, and isblank() and c32isblank() honor this where the
appropriate locales are installed.

* tests/uniq/uniq.pl: Adjust the blank check to use join(1) rather than
tr(1), as join uses the same blank determination routines as uniq(1).
---
 tests/uniq/uniq.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/uniq/uniq.pl b/tests/uniq/uniq.pl
index 34457b000..a61f26485 100755
--- a/tests/uniq/uniq.pl
+++ b/tests/uniq/uniq.pl
@@ -243,8 +243,9 @@ if ( defined $locale && $locale ne 'none' )
   {
     # I've only ever triggered the problem in a non-C locale.
 
-    # See if isblank returns true for nbsp.
-    my $x = qx!env printf '\xa0'| LC_ALL=$locale tr '[:blank:]' x!;
+    # See if nbsp is considered a blank character
+    my $x = qx!env printf 'x\xa0y'| LC_ALL=$locale join -a2 -o2.1 /dev/null -!;
+    chomp $x;
     # If so, expect just one line of output in the schar test.
     # Otherwise, expect two.
     my $in = " y z\n\xa0 y z\n";
-- 
2.44.0

Reply via email to