[1.7] wcwidth failing configure tests

Eric Blake ebb9@byu.net
Tue May 12 16:02:00 GMT 2009

I noticed this failure in various configure scripts (findutils, coreutils, ...):

checking whether wcwidth works reasonably in UTF-8 locales... no

I've reduced it to a STC:

#include <locale.h>
#include <wchar.h>
int main ()
  int i = 0;
  if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL)
      if (wcwidth (0x0301) > 0)
        i |= 1;
      if (wcwidth (0x200B) > 0)
        i |= 2;
  return i;

The return value should be 0 but is coming back as 3; 0x0301 is a combining 
mark which should occupy no space on its own, and 0x200b is a 0-width space, 
according to Unicode 5.1 (and earlier, to some extent).  And that probably 
means that other places within wcwidth() are broken.

Eric Blake

Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

More information about the Cygwin mailing list