From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18359 invoked by alias); 25 Jun 2013 15:24:04 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 18316 invoked by uid 89); 25 Jun 2013 15:23:59 -0000 X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 25 Jun 2013 15:23:59 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id A92355200E9; Tue, 25 Jun 2013 17:23:56 +0200 (CEST) Date: Tue, 25 Jun 2013 15:38:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: [BUG REPORT]sed -e 's/[B-D]/_/g' replaces unexpected characters Message-ID: <20130625152356.GD11958@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-06/txt/msg00634.txt.bz2 On Jun 25 22:37, Atry wrote: > [...] > $ echo abcdeABCDE | sed -e 's/[B-D]/_/g' > ab__eA___E Your locale is zh_CN.UTF-8. What you're expecting is only guaranteed in the C locale: $ LANG=C && echo abcdeABCDE | sed -e 's/[B-D]/_/g' The character ordering is based on the default Windows ordering for the locale, and that's dictionary ordering, apparently. This is unfortunately different from the default ordering under Linux, but off the top of my head I don't see how to change that. I'll have a look, though, but no guarantees. It's been a long time since working on Cygwin's NLS functions... 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