This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug localedata/20792] New: No locale data for character with code 0xFF


https://sourceware.org/bugzilla/show_bug.cgi?id=20792

            Bug ID: 20792
           Summary: No locale data for character with code 0xFF
           Product: glibc
           Version: 2.24
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: localedata
          Assignee: unassigned at sourceware dot org
          Reporter: igor.liferenko at gmail dot com
                CC: libc-locales at sourceware dot org
  Target Milestone: ---

Hi all,

In any locale using 8-bit encoding, islower() does not provide correct locale
data for slot 0xff. Tested on ru_RU.CP1251 and fr_FR.ISO-8859-1 locales. The
output of the following example is empty. But the output must be "lowercase".

    #include <locale.h>
    #include <ctype.h>
    #include <stdio.h>
    int main (void)
    {
      setlocale(LC_ALL, "fr_FR.ISO-8859-1"); /* ru_RU.CP1251 */

      /* 11111111 */
      char c =
        1 << 0 |
        1 << 1 |
        1 << 2 |
        1 << 3 |
        1 << 4 |
        1 << 5 |
        1 << 6 |
        1 << 7;

      if (islower(c)) printf("lowercase\n");
      return 0;
    }

As about signedness of char, just think of 8 bit character codes in HEX, and
problem disappears (both -1 and 255 are 0xFF as 8 bit HEX number on any current
CPU)

Regards,
Igor

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]