public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "egmont at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug locale/18927] Different strings should never collate as equal
Date: Wed, 09 Sep 2015 08:13:00 -0000	[thread overview]
Message-ID: <bug-18927-131-nPflgfmgLR@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-18927-131@http.sourceware.org/bugzilla/>

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

--- Comment #2 from Egmont Koblinger <egmont at gmail dot com> ---
Sorry, I wasn't explicit on this. I meant to modify both strcoll() and
strxfrm(), in accordance with each other. That is, strcoll() never to return 0
on strings that differ, and strxfrm() never to produce the same output for
different inputs.

The issue was originally discovered with the "uniq" utility which omitted
certain lines it shouldn't have omitted. E.g. in Hungarian for the input lines
"ssz" and "szsz" it only produced one output line, causing quite a headache to
the guy who discovered it.

The manual of uniq explicitly states that it honours LC_COLLATE. On the other
hand, this utility shouldn't care about sorting, it should only care about
equalness of strings. This implicly suggests that uniq's authors assume that
different strings collating as equal is a valid case and they deliberately wish
to drop these variants from the output. Otherwise they could've just gone with
strcmp(). (By the way I haven't checked its implementation, can't tell if it
uses strcoll() or strxfrm(), but it shouldn't matter.)

On the other hand, I believe this approach is error-prone, and guaranteeing
different collation for unequal strings would result in a more robust locale
system, with fewer unexpected user-facing behaviors.

Maybe we should loop in the coreutils folks to hear their opinion. Although
"uniq" probably not the only tool influenced by this.

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


  parent reply	other threads:[~2015-09-09  8:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-06 22:21 [Bug locale/18927] New: " egmont at gmail dot com
2015-09-07 12:17 ` [Bug locale/18927] " fweimer at redhat dot com
2015-09-09  7:21 ` fweimer at redhat dot com
2015-09-09  8:13 ` egmont at gmail dot com [this message]
2015-09-09  8:15 ` egmont at gmail dot com
2015-09-09  8:37 ` egmont at gmail dot com
2015-09-09 10:21 ` joseph at codesourcery dot com
2015-09-09 11:10 ` egmont at gmail dot com
2015-09-09 11:41 ` fweimer at redhat dot com
2015-09-09 13:58 ` joseph at codesourcery dot com
2015-09-09 15:28 ` egmont at gmail dot com
2015-09-09 19:23 ` egmont at gmail dot com
2023-05-31 16:57 ` carenas at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-18927-131-nPflgfmgLR@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).