Bug 14039 - strcoll inverted(?) order of uppercase/lowercase characters
Summary: strcoll inverted(?) order of uppercase/lowercase characters
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: localedata (show other bugs)
Version: 2.13
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-01 03:52 UTC by Andrzej
Modified: 2014-06-25 11:10 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrzej 2012-05-01 03:52:16 UTC
This is probably invalid, just wanted to raise a potential issue with strcoll.

When sorting ascii characters using their ascii codes 'A' < 'a'. Strcoll does the opposite 'a' < 'A' and 'ą' < 'Ą'. The problem with this approach is that, for performance reasons, a lot of programs use ascii comparison and fall back on strcoll when they encounter unicode characters. This results in inconsistent sorting, for example 'A' < 'a' and 'ą' < 'Ą'.

Should this particular sorting rule be arbitrary, would it be possible to change it (to match ascii order)?
Comment 1 Andreas Schwab 2012-05-01 07:04:36 UTC
If you want to approximate strcoll with strcmp you must first convert the string with strxfrm.