zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Multibyte output confuses "print -c" ?
Date: Sun, 10 Dec 2006 13:34:59 -0800	[thread overview]
Message-ID: <061210133500.ZM16552@torch.brasslantern.com> (raw)

I'm not entirely sure what's going on here, but:

zsh% autoload define-composed-chars
zsh% define-composed-chars
zsh% print -C 10 -- \<'\U'${(l.8..0.)^${(s. .)zsh_accented_chars}}\>

Note that the columns are not all the same width and in many cases the
closing angle bracket does not appear.  I also get exactly one "zsh:
character not in range" error, see more on that below.

Comparing the output of "print -C 1" and "print -l" on that same expansion,
there appears first to be a problem with columnation of strings containing
a nul byte.

zsh% print -c '<\U0000000T>'
<
zsh% print '<\U0000000T>' | cat -v
<^@T>

Digging a bit deeper, I find there are also some embedded newlines in the
values of $zsh_accented_chars that I don't think should be there:

<000448\nd>
<00042B\na>
<000044B\n>

So that indicates a problem in define-composed-chars.  However, there still
remain a number of cases where print fails with either -c or -l.  Digging
still further, I find that if I individually print each of the failing
values, every one of them produces "zsh: character not in range" -- but
if I print them, say, in a "for x in ..." loop, the only every alternate
one of them gives the error, and if I print multiple of them in the same
single print statement I get the error only once.  The latter sort of makes
sense but the loop behavior must be wrong; something is not being reset in
the interpolation for '\U...'?

-- 


             reply	other threads:[~2006-12-10 21:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-10 21:34 Bart Schaefer [this message]
2006-12-10 23:17 ` Peter Stephenson

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=061210133500.ZM16552@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).