zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: zle -U "$selected" doesn't handle (some?) multibyte characters
Date: Sun, 10 Jan 2016 09:18:38 +0100	[thread overview]
Message-ID: <CAKc7PVD7N_xaeXSZHB1Q4kmzayjiPA5BNTwkDM5mQF-Zj9SmFg@mail.gmail.com> (raw)

I have a following code in which "$selected" resolves to "The\ Voice\
of\ Poland\ VI\ –\ Marta\ Moszczyńska\ –\ „Sail”\ –\
Live-h9KgwUAlCjE.mkv":

if [ "$REPLY" -gt 0 ]; then
    selected="$reply[REPLY]"
    echo "$selected" > /tmp/d
    # ZLE?
    if [ "${(t)CURSOR}" = "integer-local-special" ]; then
        zle redisplay
        zle kill-whole-line
        zle -U "$selected"
    else
        print -zr "$selected"
    fi
else
    [ "${(t)CURSOR}" = "integer-local-special" ] && zle redisplay
fi

So two paths, one for the script being run from Zle, and other one
when run as function. The function path works, string is not
disrupted. The "echo" also outputs non-disrupted string. However, zle
-U "$selected" outputs: "The\ Voice\ of\ Poland\ VI\  \ Marta\
MoszczyŃska\  \  Sail \  \ Live-h9KgwUAlCjE.mkv"

The quotation marks are missing. The letter "ń" is also disrupted and
outputted as "Ń"

Best regards,
Sebastian Gniazdowski


             reply	other threads:[~2016-01-10  8:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-10  8:18 Sebastian Gniazdowski [this message]
2016-01-10  8:40 ` Sebastian Gniazdowski
2016-01-10  9:21   ` Sebastian Gniazdowski
2016-01-10 11:38     ` Sebastian Gniazdowski
2016-01-10 20:51       ` Bart Schaefer

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=CAKc7PVD7N_xaeXSZHB1Q4kmzayjiPA5BNTwkDM5mQF-Zj9SmFg@mail.gmail.com \
    --to=sgniazdowski@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).