From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 962 invoked by alias); 10 Jan 2016 08:19:02 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37536 Received: (qmail 25762 invoked from network); 10 Jan 2016 08:19:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=rinICkBTuhUPVtJijLqF3WUnR7wAC58O+K2/pFPxVNo=; b=HUks/9rVsl+TTPo1Jk6hN09tlBY8ePvIL6Ic69dbPABllKZ7M1qMBCyfSeKPIMJagi EwsjitnARz9uGvdKdC3EQGuuQH1V6D79f/x/+iCXaHLNQCcAy8ZyyG8MovE3d7t1J+gK nURv/Z5tv+Kqnmd3baXRW/uC3ZJYTekiyXXqZQACdQD8GWb6LKoQlztz6s2+hQm7gKgw GgF+674yNEoC1N1AijTw7wzBPK5GQ5MRMXe+scpewiZCLhn6cb+4aWf2mCC7jK6a0sBw tzD3qpXAL90BU8cz4fATbasrYIS7r18zTLLu3+Pdwsii2p3oMEwHLhQbcFUnObd9Fp+b PqJw== X-Received: by 10.112.137.129 with SMTP id qi1mr10138376lbb.31.1452413938258; Sun, 10 Jan 2016 00:18:58 -0800 (PST) MIME-Version: 1.0 From: Sebastian Gniazdowski Date: Sun, 10 Jan 2016 09:18:38 +0100 Message-ID: Subject: zle -U "$selected" doesn't handle (some?) multibyte characters To: Zsh hackers list Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I have a following code in which "$selected" resolves to "The\ Voice\ of\ Poland\ VI\ =E2=80=93\ Marta\ Moszczy=C5=84ska\ =E2=80=93\ =E2=80=9ESai= l=E2=80=9D\ =E2=80=93\ Live-h9KgwUAlCjE.mkv": if [ "$REPLY" -gt 0 ]; then selected=3D"$reply[REPLY]" echo "$selected" > /tmp/d # ZLE? if [ "${(t)CURSOR}" =3D "integer-local-special" ]; then zle redisplay zle kill-whole-line zle -U "$selected" else print -zr "$selected" fi else [ "${(t)CURSOR}" =3D "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\ =E2=80=83\ Marta\ Moszczy=C5=83ska\ =E2=80=83\ =E2=80=83Sail=E2=80=83\ =E2=80=83\ Live-h9KgwU= AlCjE.mkv" The quotation marks are missing. The letter "=C5=84" is also disrupted and outputted as "=C5=83" Best regards, Sebastian Gniazdowski