public inbox for glibc-bugs-regex@sourceware.org
help / color / mirror / Atom feed
* [Bug regex/11561] New: Collation characters represented by internal name instead of character sequence
@ 2010-04-30  7:36 bonzini at gnu dot org
  0 siblings, 0 replies; only message in thread
From: bonzini at gnu dot org @ 2010-04-30  7:36 UTC (permalink / raw)
  To: glibc-bugs-regex

In the glibc locale definitions, collating elements have a hyphenated name:

    collating-symbol  <zs>
    collating-element <z-s> from "<U007A><U0073>"

and the hyphenated name have to be used in regular expression for [[. .]] to
work properly:

    $ echo '*ch*' | LC_COLLATE=cs_CZ.UTF-8 sed 's/[[.c-h.]]//'
    **
    $ echo 'ch' | LC_COLLATE=cs_CZ.UTF-8 sed 's/[[.ch.]]//'
    sed: -e expression #1, char 12: Invalid collation character

However, POSIX 1.2008 says:

        A collating symbol is a collating element enclosed within
        bracket-period ( "[." and ".]" ) delimiters. Collating
        elements are defined as described in Collation Order .
        Conforming applications shall represent multi-character
        collating elements as collating symbols when it is
        necessary to distinguish them from a list of the
        individual characters that make up the multi-character
        collating element. For example, if the string "ch" is a
        collating element defined using the line:

        collating-element <ch-digraph> from "<c><h>"

        in the locale definition, the expression "[[.ch.]]" shall
        be treated as an RE containing the collating symbol 'ch',
        while "[ch]" shall be treated as an RE matching 'c' or
        'h' . Collating symbols are recognized only inside
        bracket expressions. If the string is not a collating
        element in the current locale, the expression is invalid.

POSIX especially mentions [[.ch.]] in the example instead of [[.ch-digraph.]] so
this is a bug in glibc.  It shouldn't be hard to fix it in regcomp.

-- 
           Summary: Collation characters represented by internal name
                    instead of character sequence
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: regex
        AssignedTo: bonzini at gnu dot org
        ReportedBy: bonzini at gnu dot org
                CC: glibc-bugs-regex at sources dot redhat dot com,glibc-
                    bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11561

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-30  7:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-30  7:36 [Bug regex/11561] New: Collation characters represented by internal name instead of character sequence bonzini at gnu dot org

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).