zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: invalid characters and multi-byte [x-y] ranges
Date: Thu, 3 Sep 2015 00:07:11 +0100	[thread overview]
Message-ID: <20150902230711.GA4967@chaz.gmail.com> (raw)

Hello,

is this (in a UTF-8 locale):

$ zsh -c $'[[ \xcc = [\uaa-\udd] ]]' && echo yes
yes

expected or desirable? I know I can't expect much since \xcc is
not a valid character, but I wouldn't have expected it to match
[\uaa-\udd] there.

Same for:

$ zsh -c $'[[ \xcc = [[:alpha:]] ]]' && echo yes
yes

It seems \xcc is treated as U+00CC here (which in UTF-8 is
\xc3\x8c)

$ zsh -c $'[[ \xcc = \ucc ]]' && echo yes
$ zsh -c $'[[ \xcc = [\ucc] ]]' && echo yes
yes

-- 
Stephane


             reply	other threads:[~2015-09-02 23:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 23:07 Stephane Chazelas [this message]
2015-09-03  9:00 ` Peter Stephenson
2015-09-03 10:09   ` Stephane Chazelas
2015-09-03 14:18     ` Peter Stephenson
2015-09-04 10:53       ` Ismail Donmez
2015-09-04 11:47         ` Peter Stephenson
2015-09-04 12:35           ` Peter Stephenson
2015-09-04 15:02             ` Ismail Donmez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150902230711.GA4967@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).