From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16566 invoked from network); 7 Dec 2008 21:26:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Dec 2008 21:26:57 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 84048 invoked from network); 7 Dec 2008 21:26:48 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Dec 2008 21:26:48 -0000 Received: (qmail 2716 invoked by alias); 7 Dec 2008 21:26:32 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13543 Received: (qmail 2705 invoked from network); 7 Dec 2008 21:26:31 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 7 Dec 2008 21:26:31 -0000 Received: from elation.princeton.edu (elation.Princeton.EDU [128.112.144.224]) by bifrost.dotsrc.org (Postfix) with ESMTP id A546780308BE for ; Sun, 7 Dec 2008 22:26:28 +0100 (CET) Received: from [192.168.1.101] (pool-70-20-71-248.pitbpa.east.verizon.net [70.20.71.248]) by elation.princeton.edu (Postfix) with ESMTP id C00B81E1D3AFD; Sun, 7 Dec 2008 16:22:22 -0500 (EST) Date: Sun, 7 Dec 2008 16:26:22 -0500 (EST) From: "Benjamin R. Haskell" To: Zsh Users Subject: Re: utf-8 and zsh In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LNX 1169 2008-08-27) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463811810-1431656985-1228685186=:8543" X-Virus-Scanned: ClamAV 0.92.1/8730/Sun Dec 7 07:03:03 2008 on bifrost X-Virus-Status: Clean This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463811810-1431656985-1228685186=:8543 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Sun, 7 Dec 2008, Maurício wrote: > Hi, > > Is there some zsh-specific way to enter utf-8 characters? Or should I > rely on my terminal to do that (xterm, mlterm etc.)? > There are two ZLE widgets related to entering special characters: insert-composed-char and insert-unicode-char To use them, put this somewhere in your Zsh startup files: autoload insert-composed-char zle -N insert-composed-char # bind it to some key (Ctrl+x in this example) bindkey ^X insert-composed-char autoload insert-unicode-char zle -N insert-unicode-char bindkey ^Y insert-unicode-char Then, the key sequence: ^X e ' creates é, for example. See man zshall for the full list. (search for insert-composed-char) NB. On my system, though, it doesn't appear to be fully working (Both ^X i ` and ^X i ' produce ì (even though the latter should produce í)) For an arbitrary Unicode point, you do: ^Y e 9 ^Y (é) ^Y 2 0 1 9 ^Y (’) (That is: whatever-you-bound-it-to, the code in hexadecimal, then the bound key again.) Really, though, I've only found these useful outside of X11. Recent things I've read say that X11 Input Methods are preferred to X11 Compose. But, I've found that Compose is what works best for me (a native English speaker -- so, I only rarely need accented/other chars). With Compose, for example, I can type Compose-key (which I've mapped to 'Menu'), e ', and get é. The sequences mostly seem logical (compose a e = æ), and there are a lot of them. (I actually made a custom keyboard map, which also puts some of the ones I use most frequently as AltGr keys.) Best, Ben ---1463811810-1431656985-1228685186=:8543--