zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] [[:blank:]] only matches on SPC and TAB
Date: Mon, 14 May 2018 16:51:31 +0100	[thread overview]
Message-ID: <20180514155131.GC7263@chaz.gmail.com> (raw)
In-Reply-To: <20180514145056.3eedaea9@camnpupstephen.cam.scsc.local>

2018-05-14 14:50:56 +0100, Peter Stephenson:
[...]
> It wouldn't be ridiculous to change the documentation for this case and
> require "unsetopt multibyte" for strict byte-by-byte comparisions, which
> is already how it works in the vast majority of other cases.
[...]

But note that here it's not about multibyte vs singlebyte but
whether [:blank:] honours the locale like the other POSIX
character classes (alpha, punct...) do.

There are locales on some systems (like NetBSD already
mentioned) that use a single-byte charset where more than SPC
and TAB are classified as "blank" (like 0xA0 (nbsp) in locales
using iso8859-x charsets or 0x9A in KOI8-R on NetBSD).

IMO, without the "multibyte" option, we should still call
isblank() which on most systems and most locales will match only
on SPC and TAB but is not guaranteed to (and does not in
practice like on NetBSD).

I just noticed that on NetBSD, in locales using UTF-8 or
GB18030, isblank() returns true on \v (vertical TAB), not in any
other locale! So does iswblank(). So out goes my claim that
"blank" should be for horizontal spaces. On OpenBSD (where only
UTF-8 charsets are supported in locales other than C/POSIX),
iswblank() matches on \v and \f. 

What a mess!

-- 
Stephane


  reply	other threads:[~2018-05-14 15:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-13 21:25 Stephane Chazelas
2018-05-13 21:49 ` [PATCH v2] " Stephane Chazelas
2018-05-14  2:27 ` [PATCH] " Sebastian Gniazdowski
2018-05-14  4:41   ` Sebastian Gniazdowski
2018-05-14  6:36   ` Stephane Chazelas
2018-05-14  6:44     ` Stephane Chazelas
2018-05-14  8:47       ` Peter Stephenson
2018-05-14 12:34         ` Stephane Chazelas
2018-05-14 13:50           ` Peter Stephenson
2018-05-14 15:51             ` Stephane Chazelas [this message]
2018-05-14 16:31               ` Sebastian Gniazdowski
2018-05-14 16:50                 ` Bart Schaefer
2018-05-14 19:52                   ` Daniel Tameling
2018-05-14 20:42                     ` Stephane Chazelas
2018-05-15 18:12                       ` Stephane Chazelas
2018-05-16  4:18                         ` Sebastian Gniazdowski
2018-05-15 19:06               ` Oliver Kiddle
2018-05-16 13:15                 ` Stephane Chazelas
2018-05-16 13:40                   ` Peter Stephenson
2018-05-16 16:31                     ` Stephane Chazelas
2018-05-16 21:02                       ` [PATCH v4] " Stephane Chazelas
2018-05-17  8:29                         ` Peter Stephenson
2018-05-17 22:05                       ` [PATCH] " Oliver Kiddle
2018-05-17  9:03           ` Sebastian Gniazdowski
2018-05-17 10:10             ` Sebastian Gniazdowski
2018-05-14  8:11     ` Sebastian Gniazdowski

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=20180514155131.GC7263@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=p.stephenson@samsung.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).