[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Fedora-i18n-bugs] [Bug 537753] New: glibc: wcscoll/strcoll needs to check if the char is out of the locale collation.



Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.

Summary: glibc: wcscoll/strcoll needs to check if the char is out of the locale collation.

https://bugzilla.redhat.com/show_bug.cgi?id=537753

           Summary: glibc: wcscoll/strcoll needs to check if the char is
                    out of the locale collation.
           Product: Fedora
           Version: rawhide
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: medium
          Priority: low
         Component: glibc
        AssignedTo: schwab redhat com
        ReportedBy: tfujiwar redhat com
         QAContact: extras-qa fedoraproject org
                CC: jakub redhat com, fedora-i18n-bugs redhat com,
                    schwab redhat com
   Estimated Hours: 0.0
    Classification: Fedora
    Target Release: ---


Created an attachment (id=369656)
 --> (https://bugzilla.redhat.com/attachment.cgi?id=369656)
Example test case

Currently I'm thinking how to sort UTF-8 strings on GNOME/GDM.

GDM uses g_utf8_collate() to sort the language names.
http://git.gnome.org./cgit/glib/tree/glib/gunicollate.c

g_utf8_collate() uses wcscoll() internally.

----------------------------
 70:gint
 71: g_utf8_collate (const gchar *str1,
 72:  const gchar *str2)
 73:{
...
109:  result = wcscoll ((wchar_t *)str1_norm, (wchar_t *)str2_norm);
...
154:}
----------------------------

However if the chars are not defined in the locale collation, the returned
value is not correct.
I'm attaching the test program.
You could see the returned value is not correct on ja_JP.UTF-8.

Now I think it's better to set errno if the char is not defined in the
collation.
Regarding to WCSCOLL(3P):

----------------------------
RETURN VALUE
On  error,  wcscoll()  shall  set
       errno, but no return value is reserved to indicate an error.

ERRORS
       The wcscoll() function may fail if:

       EINVAL The  ws1  or  ws2 arguments contain wide-character codes outside
              the domain of the collating sequence.
----------------------------

If wcscoll/strcoll/wscxfrm/strxfrm would set errno, I could enhance
g_utf8_collate(_key) later.

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]