This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 136292 - wrong handling of regex on UTF-8 locale
wrong handling of regex on UTF-8 locale
Product: Fedora
Classification: Fedora
Component: grep (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
: i18n
Depends On:
  Show dependency treegraph
Reported: 2004-10-19 04:28 EDT by Akira TAGOH
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-19 04:50:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:

Attachments (Terms of Use)

  None (edit)
Description Akira TAGOH 2004-10-19 04:28:38 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.7.3)
Gecko/20041007 Debian/1.7.3-5

Description of problem:
the handling of character range for regex seems wrong on UTF-8 locale.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.echo A | LANG=en_US.UTF-8 grep '[a-z]'
2.echo A | LANG=C grep '[a-z]'

Actual Results:  output 'A' on en_US.UTF-8

Expected Results:  it should be nothing to output

Additional info:

character range seems to be a A b B ... by wcscoll in dfa.c on UTF-8

for another testcase,

[tagoh@devel02 ~]$ echo A | LANG=ja_JP.UTF-8 grep '[a-z]'
[tagoh@devel02 ~]$ echo A | LANG=ko_KR.UTF-8 grep '[a-z]'
[tagoh@devel02 ~]$ echo A | LANG=zh_CN.UTF-8 grep '[a-z]'
[tagoh@devel02 ~]$ echo A | LANG=zh_TW.UTF-8 grep '[a-z]'
Comment 1 Tim Waugh 2004-10-19 04:50:00 EDT
No, you meant to use '[[:lower:]]'. [a-z] is never what you want unless you are
in the C locale.

Note You need to log in before you can comment on or make changes to this bug.