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

Submitted by:  None
Submitted on:  Thu 03 Feb 2011 12:07:11 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Confirmed
Privacy: PublicAssigned to: None
Open/Closed: Closed

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

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 29 Jun 2011 06:30:45 AM UTCbonziniStatusNone=>Confirmed
      Open/ClosedOpen=>Closed
      Summary[:alnum:] depends on locale=>[:alnum:] dependance on locale is not well documented
    Tue 28 Jun 2011 10:39:17 PM UTCslavazankoCarbon-Copy-=>Added slavazanko

    Back to the top


    Powered by Savane 3.1-cleanup1