This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BUG REPORT]sed -e 's/[B-D]/_/g' replaces unexpected characters


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]