zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: UTF-8 input [was Re: PATCH: zle_params.c]
Date: Thu, 10 Feb 2005 15:06:12 +0000	[thread overview]
Message-ID: <200502101506.j1AF6DUt006565@news01.csr.com> (raw)
In-Reply-To: <1050210145119.ZM22337@candle.brasslantern.com>

Bart Schaefer wrote:
> So if, for example, I do
> 
> 	BUFFER="$LBUFFER$KEYS$RBUFFER"
> 
> this is going to convert LBUFFER and RBUFFER from wide chars to metafied
> on expansion, and then convert the whole quoted string back to wide chars
> upon assignment?

Yes, the ZLE parameter interface is responsible for the conversion of
the bits of the buffer in both directions, and, as it happens, $KEYS
doesn't need converting.

> } I suspect we will want a flag such as ${(m)#KEYS} to treat the string
> } as a multibyte character string instead of raw bytes and maybe a
> } ${(M)#KEYS} not to.
> 
> (M) is already taken, as are (w) and (W).

I missed that, but maybe we don't need it if the default is raw bytes.

> I presume you mean (m) to be like (c) in that it works only with ${#...}.
> Otherwise I'm even more confused.

Well, it would be anywhere the distinction made sense, but counting
lengths is the only obvious one.  Anywhere involving pattern matching
would need to go with the locale, I would think; anything else is too
horrendous to contemplate.

> } [...] argue for it to handle multibyte strings by default in a suitable
> } locale, but when Perl did that it broke everything in sight.
> 
> I'm not arguing for that ... if anything, I'm arguing against it.

Compatibility with other shells would be the only good reason I can see,
but that could be an option.  There are plenty of
do_something_done_by_other_shells_however_idiotic options.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


      reply	other threads:[~2005-02-10 15:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-26 18:06 PATCH: zle_params.c Peter Stephenson
2005-01-26 18:35 ` Clint Adams
2005-01-29  3:47 ` UTF-8 input [was Re: PATCH: zle_params.c] Clint Adams
2005-01-30  1:07   ` Peter Stephenson
2005-01-30  6:35     ` Bart Schaefer
2005-01-31 11:46       ` Peter Stephenson
2005-01-31 16:18         ` Bart Schaefer
2005-01-31 17:01           ` Peter Stephenson
2005-01-31 18:29             ` Bart Schaefer
2005-02-01 10:37               ` Peter Stephenson
2005-02-10 14:22       ` Peter Stephenson
2005-02-10 14:51         ` Bart Schaefer
2005-02-10 15:06           ` Peter Stephenson [this message]

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=200502101506.j1AF6DUt006565@news01.csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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).