X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=Aj2OyUdRLg+Y5kPhhY/BH/ABGXdvBnf/ujFqJPC6PLPLyBSjVUI/Z
	8By32dXoLvvE8we2Qipjbv5DYlaoALTpqtFr7GD0GgEwOBqeS85BmQmW5B0YQ//Z
	Rlzt3Kz1XveSafT8mV84fNmwHQyvdfbxGYrcpGPHEzDpgI03CEttYM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=dAPHO3hRQjhyGLIxuF0bkicbLvk=; b=aqGUEGjY2vUV37/FaFX3/TPNFFil
	CiovbXJRt9hTGlINZP5E6EtEojIP8UikV5d5Ym23JGuidRtXc94HQ7VVuFb8zSCj
	an+syuzwkNwfeSRw1pgA+c584eOijnqY/zkkQideY1wGmYtbW0pYEySZpr8dGrs3
	5mE/EEvY6tlhjfg=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1
Date: Tue, 25 Jun 2013 18:03:59 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: [BUG REPORT]sed -e 's/[B-D]/_/g' replaces unexpected characters
Message-ID: <20130625160359.GB14459@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <CA+nJC97He=j-O2FZ-Y2jJhYXEJn2o2EfC1wO39+2bZ=nj1f-zA@mail.gmail.com> <20130625152356.GD11958@calimero.vinschen.de> <5F8AAC04F9616747BC4CC0E803D5907D0C37C240@MLBXv04.nih.gov>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <5F8AAC04F9616747BC4CC0E803D5907D0C37C240@MLBXv04.nih.gov>
User-Agent: Mutt/1.5.21 (2010-09-15)

On Jun 25 15:38, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
> > Your locale is zh_CN.UTF-8.  What you're expecting is only guaranteed
> > in the C locale:
> 
> I'm not quite sure it applies here.  I'm using US English Windows 7.
> 
> LANG = 'en_US.UTF-8'
> 
> I get the same result:
> 
> $ echo abcdeABCDE | sed -e 's/[B-D]/_/g'
> ab__eA___E
> 
> BUT:
> 
> $ echo abcdeABCDE | LANG=C sed 's/[B-D]/_/g'
> abcdeA___E
> 
> This is very weird, indeed.
> 
> OTOH, in Linux I have the same LANG setup, yet it does work
> correctly:
> 
> > echo $LANG
> en_US.UTF-8
> > echo abcdeABCDE | sed -e 's/[B-D]/_/g'
> abcdeA___E
> 
> I believe that an en_US UTF-8 string representation for
> "abcdeABCDE" is not any different from ASCII.

Wrong.  Try this:

  $ sort
  a
  b
  c
  d
  e
  A
  B
  C
  D
  E
  <Ctrl-D>
  a
  A
  b
  B
  c
  C
  d
  D


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

