Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zle -U "$selected" doesn't handle (some?) multibyte characters



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



Messages sorted by: Reverse Date, Date, Thread, Author