summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--doc/posix-functions/wcwidth.texi4
-rw-r--r--tests/test-wcwidth.c6
3 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d62eb6145f..5d1df96cfd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2019-12-12 Bruno Haible <bruno@clisp.org>
+ wcwidth: Avoid test failure on AIX 7.2.
+ * tests/test-wcwidth.c (main): Don't fail if wcwidth(0x200B) is
+ negative.
+ * doc/posix-functions/wcwidth.texi: Mention the AIX issue.
+
+2019-12-12 Bruno Haible <bruno@clisp.org>
+
ilogbl: Work around Cygwin bug.
* m4/ilogbl.m4 (gl_FUNC_ILOGBL_WORKS): Test whether ilogbl(0.0L) is
correct.
diff --git a/doc/posix-functions/wcwidth.texi b/doc/posix-functions/wcwidth.texi
index 0acc1c4aff..a3afe9ba0d 100644
--- a/doc/posix-functions/wcwidth.texi
+++ b/doc/posix-functions/wcwidth.texi
@@ -29,4 +29,8 @@ Portability problems not fixed by Gnulib:
@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
+@item
+This function treats zero-width spaces like control characters on some
+platforms:
+AIX 7.2.
@end itemize
diff --git a/tests/test-wcwidth.c b/tests/test-wcwidth.c
index 8e9cea3e49..ecb50cd00f 100644
--- a/tests/test-wcwidth.c
+++ b/tests/test-wcwidth.c
@@ -69,7 +69,11 @@ main ()
#endif
/* Test width of some zero width characters. */
- ASSERT (wcwidth (0x200B) == 0);
+ /* While it is desirable that U+200B, U+200C, U+200D have width 0,
+ because this makes wcswidth work better on strings that contain these
+ characters, it is acceptable if an implementation treats these
+ characters like control characters. */
+ ASSERT (wcwidth (0x200B) <= 0);
ASSERT (wcwidth (0xFEFF) <= 0);
/* Test width of some math symbols.