This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: [BUG REPORT]sed -e 's/[B-D]/_/g' replaces unexpected characters
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 25 Jun 2013 17:23:56 +0200
- Subject: Re: [BUG REPORT]sed -e 's/[B-D]/_/g' replaces unexpected characters
- References: <CA+nJC97He=j-O2FZ-Y2jJhYXEJn2o2EfC1wO39+2bZ=nj1f-zA at mail dot gmail dot com>
- Reply-to: cygwin at cygwin dot com
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