From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Evil Boris Newsgroups: gmane.emacs.devel Subject: Re: Using quail input methods to translate buffer text. Date: Thu, 06 Jul 2006 08:11:22 -0400 Message-ID: References: <87k66rlqys.fsf@heslin.eclipse.co.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1152187939 12477 80.91.229.2 (6 Jul 2006 12:12:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Jul 2006 12:12:19 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 06 14:12:17 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FySiL-0003jb-Nc for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 14:12:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FySiL-0006Ks-2o for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 08:12:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FySiA-0006KS-VD for emacs-devel@gnu.org; Thu, 06 Jul 2006 08:12:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FySi9-0006K9-3X for emacs-devel@gnu.org; Thu, 06 Jul 2006 08:12:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FySi8-0006K6-Vx for emacs-devel@gnu.org; Thu, 06 Jul 2006 08:12:01 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FySiK-0002sj-DG for emacs-devel@gnu.org; Thu, 06 Jul 2006 08:12:12 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FyShy-0003eL-9j for emacs-devel@gnu.org; Thu, 06 Jul 2006 14:11:50 +0200 Original-Received: from 207-38-193-43.c3-0.wsd-ubr1.qens-wsd.ny.cable.rcn.com ([207.38.193.43]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Jul 2006 14:11:50 +0200 Original-Received: from evilborisnet by 207-38-193-43.c3-0.wsd-ubr1.qens-wsd.ny.cable.rcn.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Jul 2006 14:11:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 27 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207-38-193-43.c3-0.wsd-ubr1.qens-wsd.ny.cable.rcn.com User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) Cancel-Lock: sha1:bGo56oQzPEDJcDZUW+s8y9Vp+yI= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56626 Archived-At: Peter Heslin writes: > I have some ascii text that I want to convert to utf-8, and it is > encoded in a manner just like one of the quail input methods. Can > anyone tell me if there is a function that will take text from a buffer > and treat it as if it were input as keystrokes to quail, and then output > the result in Unicode? I have run into a similar problem. I have not found a solution yet, maybe because I did not look too hard. :-) However, here's an exceedingly cheap trick that may work. Run Emacs in terminal mode (-nw) mode. Open a new buffer in a new window and set its input method to the one you want. Now copy-paste the text you want into the new buffer using the mouse and voila! I just checked it here and it worked, sort of. I have an Emacs running in a Putty terminal window and I was able to turn text into Cyrillic (Koi8-r, if you care) by just pasting from one window to another. (Accidentally picking up already encoded text and pasting it produces spectacular gibberish.) I would love to know of a nicer way of doing this. Cheers, --Boris