buggrep - Bugs: bug #32337, [:alnum:] dependance on locale is...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #32337: [:alnum:] dependance on locale is not well documented

Submitter:  None
Submitted:  Thu 03 Feb 2011 12:07:11 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Confirmed Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Discussion

Wed 29 Jun 2011 06:30:45 AM UTC, comment #2: 

Fixed in commit 406ab56cdd977fbd05216392ac655dd7204a307a



Thank you for the bug report. This bug has been fixed in the
development sources, which can be downloaded using git from
git://git.sv.gnu.org/grep.git

Paolo Bonzini <bonzini>
Thu 03 Feb 2011 01:03:14 PM UTC, comment #1: 

The man page here is misleading. [:alnum:] does not mean a-zA-Z0-9, it means "the set of characters with the letter and/or number property in the current locale".

Grep's behavior is correct here, but the man page could do with improvement. Suggested rewording:

For example, [[:alnum:]] means the character class of numbers and letters in the current locale (in the C locale and ASCII character set encoding, this is the same as [0-9A-Za-z]).

Reuben Thomas <rrt>
Thu 03 Feb 2011 12:07:11 PM UTC, original submission:  

In the grep man page it is written: "For  example, [[:alnum:]]
means [0-9A-Za-z], except the latter form depends upon the C
locale and the ASCII character encoding, whereas the former is
independent of locale and character set."

However, in my UTF-8 environment (LANG=de_DE.UTF-8) I get

$ echo -e "Haus\nHäuser\n" | LANG=de_DE.UTF-8 ./grep -E '^[[:alnum:]]+$'
Haus
Häuser

$ echo -e "Haus\nHäuser\n" | LANG=C ./grep -E '^[[:alnum:]]+$'
Haus

From the man-page I expected both cases to match only against the first line.

grep-version: 2.7 (also confirmed on 2.5.3 and 2.5.4)
debian lenny

Anonymous

 

Attached Files

This item currently has no attached files.

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by bonzini (Posted a comment)
  • -email is unavailable- added by slavazanko (Related to https://savannah. ... u.org/bugs/?24452)
  • -email is unavailable- added by rrt (Posted a comment)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    History

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-06-29 bonzini StatusNone Confirmed
        Open/ClosedOpen Closed
        Summary[:alnum:] depends on locale [:alnum:] dependance on locale is not well documented
    2011-06-28 slavazanko Carbon-Copy- Added slavazanko

    Back to the top

    Powered by Savane 3.16-a7ba.
    Corresponding source code